Skip to content

Commit 91cde36

Browse files
committed
[cmake] win fix for vcpkg and multithreaded compilation, -FS flag in nvcc
1 parent 5284b46 commit 91cde36

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,12 @@ if(CCTAG_WITH_CUDA)
199199
endif()
200200
endif()
201201

202+
# This is needed on windows for the multi-threaded compilation, typically ninja and vcpkg
203+
# it avoids the error C1041: cannot open program database, write to the same .PDB file because of concurrent access
204+
if(MSVC)
205+
list(APPEND CUDA_NVCC_FLAGS "-Xcompiler" "-FS")
206+
endif()
207+
202208
if(CCTAG_NVCC_WARNINGS)
203209
list(APPEND CUDA_NVCC_FLAGS -Xptxas --warn-on-local-memory-usage)
204210
list(APPEND CUDA_NVCC_FLAGS -Xptxas --warn-on-spills)

0 commit comments

Comments
 (0)