mirror of
https://github.com/NVIDIA/cuda-samples.git
synced 2026-04-02 15:45:41 +08:00
Bug 5701423: Add MSVC-specific flag /Zc:preprocessor as CCCL change the warning of this flag to error
This commit is contained in:
parent
70fcdd353f
commit
17113ea87e
@ -1,5 +1,8 @@
|
||||
## Changelog
|
||||
|
||||
### CUDA 13.2
|
||||
* Added the MSVC compile flag `-Xcompiler=/Zc:preprocessor` in CMakeLists.txt to comply with CUDA13.2 CCCL. Previously, using the traditional preprocessor triggered the warning “MSVC/cl.exe with traditional preprocessor is used…”, which now leads to a build error.
|
||||
|
||||
### CUDA 13.1
|
||||
* Minor bug fixes and enhancements, no structural or functional changes
|
||||
|
||||
|
||||
@ -22,6 +22,11 @@ endif()
|
||||
|
||||
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} --extended-lambda")
|
||||
|
||||
# Add MSVC-specific flags for standard-conforming preprocessor (required for CCCL)
|
||||
if(MSVC)
|
||||
add_compile_options($<$<COMPILE_LANGUAGE:CUDA>:-Xcompiler=/Zc:preprocessor>)
|
||||
endif()
|
||||
|
||||
# Include installation configuration before processing samples
|
||||
include(cmake/InstallSamples.cmake)
|
||||
|
||||
|
||||
@ -39,10 +39,7 @@ if(${OpenGL_FOUND})
|
||||
# Add target for particles
|
||||
add_executable(particles particleSystem.cpp particleSystem_cuda.cu particles.cpp render_particles.cpp shaders.cpp)
|
||||
|
||||
target_compile_options(particles PRIVATE
|
||||
$<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>
|
||||
$<$<AND:$<COMPILE_LANGUAGE:CUDA>,$<BOOL:${MSVC}>>:-Xcompiler="/Zc:preprocessor">
|
||||
)
|
||||
target_compile_options(particles PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>)
|
||||
|
||||
target_compile_features(particles PRIVATE cxx_std_17 cuda_std_17)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user