diff --git a/windows/CMakeLists.txt b/windows/CMakeLists.txt index 1179a2e..69e8ac1 100755 --- a/windows/CMakeLists.txt +++ b/windows/CMakeLists.txt @@ -11,6 +11,8 @@ set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_PROFILE} /MT") # 添加编码和警告处理 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /utf-8") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4819 /wd4244 /wd4458") +# 添加 /FS 标志以支持并行编译时的 PDB 文件访问(解决 C1041 错误) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /FS") # The name of the executable created for the application. Change this to change # the on-disk name of your application. @@ -50,7 +52,7 @@ add_definitions(-DUNICODE -D_UNICODE) function(APPLY_STANDARD_SETTINGS TARGET) target_compile_features(${TARGET} PUBLIC cxx_std_17) target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100" /wd"4819" /wd"4244" /wd"4458") - target_compile_options(${TARGET} PRIVATE /EHsc /utf-8) + target_compile_options(${TARGET} PRIVATE /EHsc /utf-8 /FS) target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0") target_compile_definitions(${TARGET} PRIVATE "$<$:_DEBUG>") # 确保目标使用静态链接