fix(client/windows): runner 加 /utf-8 编译选项,根治 C4819 中文注释编译失败
win32_window.cpp 含中文注释(UTF-8 无 BOM),在 zh-CN 机器(代码页 936)+ 新版 MSVC 上报 C4819「字符无法用当前代码页表示」,叠加 runner 的 /WX 直接 error C2220 编译失败。APPLY_STANDARD_SETTINGS 加 /utf-8,让 MSVC 按 UTF-8 解析 所有 runner 源码,永久根治。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -39,7 +39,9 @@ add_definitions(-DUNICODE -D_UNICODE)
|
||||
# of modifying this function.
|
||||
function(APPLY_STANDARD_SETTINGS TARGET)
|
||||
target_compile_features(${TARGET} PUBLIC cxx_std_17)
|
||||
target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100")
|
||||
# /utf-8: 按 UTF-8 解析源码,否则 zh-CN 机器(代码页 936)对含中文注释的 runner
|
||||
# 源码(如 win32_window.cpp)报 C4819,叠加 /WX 直接编译失败。
|
||||
target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100" /utf-8)
|
||||
target_compile_options(${TARGET} PRIVATE /EHsc)
|
||||
target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0")
|
||||
target_compile_definitions(${TARGET} PRIVATE "$<$<CONFIG:Debug>:_DEBUG>")
|
||||
|
||||
Reference in New Issue
Block a user