From 5bd90afeb7493f45d55a0b33c004abff26e14df3 Mon Sep 17 00:00:00 2001 From: Ziyu Date: Fri, 10 Oct 2025 09:17:42 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=83=A8=E5=88=86=E7=94=B5=E8=84=91WinM?= =?UTF-8?q?ain=E5=85=A5=E5=8F=A3=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmake/CompilerSettings.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmake/CompilerSettings.cmake b/cmake/CompilerSettings.cmake index e01cca9..cd7b3af 100644 --- a/cmake/CompilerSettings.cmake +++ b/cmake/CompilerSettings.cmake @@ -14,8 +14,10 @@ function(setup_compiler_options TARGET_NAME) if(MSVC) # Visual Studio: 启用所有警告 + UTF-8编码支持 target_compile_options(${TARGET_NAME} PRIVATE /W4 /utf-8) + # 添加并行编译支持 + add_compile_options(/MP) # 不要弹出控制台窗口 - target_link_options(${TARGET_NAME} PRIVATE "/SUBSYSTEM:WINDOWS") + target_link_options(${TARGET_NAME} PRIVATE "/SUBSYSTEM:WINDOWS" "/ENTRY:mainCRTStartup") elseif(WIN32 AND (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")) # MinGW/Clang on Windows: 设置UTF-8编码 target_compile_options(${TARGET_NAME} PRIVATE -Wall -Wextra -Wpedantic -finput-charset=utf-8 -fexec-charset=utf-8)