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)