From 55b7234d21be0c1683ea691b27b46333e219cd5a Mon Sep 17 00:00:00 2001 From: Pascal Date: Sun, 17 May 2026 14:41:39 +0200 Subject: [PATCH] cmake: scope /utf-8 to C and C++ so nvcc does not treat it as an input file --- CMakeLists.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c63d3ff..8206fd2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,10 +22,13 @@ find_package(Threads REQUIRED) # Suppress MSVC fopen/sprintf deprecation warnings, force UTF-8 source and # execution charsets so non-ASCII string literals (CJK language names, # punctuation tables in BPE and prompt builder) survive the compile -# without a BOM. +# without a BOM. /utf-8 is restricted to C and C++ since nvcc treats a +# bare /utf-8 as an input filename and aborts with "A single input file +# is required". CUDA sources do not carry CJK literals so they do not +# need this flag. if(MSVC) add_compile_definitions(_CRT_SECURE_NO_WARNINGS) - add_compile_options(/utf-8) + add_compile_options($<$:/utf-8>) endif() # Put executables and backend .so in the same directory (build root).