From 685685b4b3e44af4bb20938e8cb7646181765e16 Mon Sep 17 00:00:00 2001 From: Billy Robert O'Neal III Date: Tue, 18 Aug 2026 18:15:57 -0700 Subject: [PATCH 1/2] CUDA 13.x/MSVC: Add /Zc:preprocessor This issue was detected by GPT 5.6 Sol while reviewing https://github.com/microsoft/vcpkg/pull/53264 See also https://github.com/NVIDIA/cccl/pull/6791 where NVIDIA works around this problem themselves but several outstanding versions of CUDA 13.x need the workaround. The generator expression `"$<$:/Zc:preprocessor>"` was suggested by GPT 5.6 Sol. I considered adding to your existing `target_compile_options` call rather than adding another one but I wasn't sure how you would want that formatted with the existing `PRIVATE` options that are currently blocked together. --- src/stdgpu/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/stdgpu/CMakeLists.txt b/src/stdgpu/CMakeLists.txt index 937b60d1f..469acfd93 100644 --- a/src/stdgpu/CMakeLists.txt +++ b/src/stdgpu/CMakeLists.txt @@ -142,6 +142,7 @@ endif() target_compile_features(stdgpu PUBLIC cxx_std_17) +target_compile_options(stdgpu PUBLIC $<$:/Zc:preprocessor>) target_compile_options(stdgpu PRIVATE ${STDGPU_DEVICE_FLAGS} ${STDGPU_HOST_FLAGS}) From 668ad975afd5010cb9ec75fefe80214b6c6330b9 Mon Sep 17 00:00:00 2001 From: Billy Robert O'Neal III Date: Fri, 21 Aug 2026 14:13:10 -0700 Subject: [PATCH 2/2] Move the change to `thrust::thrust`. --- cmake/Findthrust.cmake | 1 + src/stdgpu/CMakeLists.txt | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/Findthrust.cmake b/cmake/Findthrust.cmake index 817d421d5..58ea64e46 100644 --- a/cmake/Findthrust.cmake +++ b/cmake/Findthrust.cmake @@ -60,6 +60,7 @@ if(thrust_FOUND) add_library(thrust::thrust INTERFACE IMPORTED) set_target_properties(thrust::thrust PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${THRUST_INCLUDE_DIRS}") + target_compile_options(thrust::thrust INTERFACE $<$:/Zc:preprocessor>) mark_as_advanced(THRUST_INCLUDE_DIR THRUST_INCLUDE_DIR_VARS diff --git a/src/stdgpu/CMakeLists.txt b/src/stdgpu/CMakeLists.txt index 469acfd93..937b60d1f 100644 --- a/src/stdgpu/CMakeLists.txt +++ b/src/stdgpu/CMakeLists.txt @@ -142,7 +142,6 @@ endif() target_compile_features(stdgpu PUBLIC cxx_std_17) -target_compile_options(stdgpu PUBLIC $<$:/Zc:preprocessor>) target_compile_options(stdgpu PRIVATE ${STDGPU_DEVICE_FLAGS} ${STDGPU_HOST_FLAGS})