Skip to content

Commit 7c7ee0b

Browse files
fix: add /Zc:preprocessor for MSVC with CUDA 13.2+
CUDA 13.2's CCCL headers require MSVC's standard conforming preprocessor. Pass /Zc:preprocessor to cl.exe via -Xcompiler. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent bd063ea commit 7c7ee0b

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,11 @@ if(BUILD_CUDA)
194194
string(APPEND CMAKE_CUDA_FLAGS " --compress-mode=size")
195195
endif()
196196

197+
# CUDA 13.2+ CCCL headers require MSVC's standard conforming preprocessor.
198+
if(MSVC AND CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL "13.2")
199+
string(APPEND CMAKE_CUDA_FLAGS " -Xcompiler=/Zc:preprocessor")
200+
endif()
201+
197202
if(PTXAS_VERBOSE)
198203
string(APPEND CMAKE_CUDA_FLAGS " -Xptxas=-v")
199204
endif()

0 commit comments

Comments
 (0)