Skip to content

Commit 562fc4e

Browse files
Try improving VS2026 + CUDA < 13.2 compat.
1 parent be785d7 commit 562fc4e

1 file changed

Lines changed: 1 addition & 8 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -136,21 +136,14 @@ if(BUILD_CUDA)
136136
# NVCC normally will only work with MSVC up to 1939. VS2022 17.10+ starts using versions 1940+.
137137
# Workaround: use --allow-unsupported-compiler
138138
# This needs to be added *before* we try to enable the CUDA language so CMake's compiler check passes.
139-
140139
if(MSVC AND MSVC_VERSION VERSION_GREATER_EQUAL 1940)
141140
string(APPEND CMAKE_CUDA_FLAGS " --allow-unsupported-compiler")
142141

143142
# Suppress MSVC STL version mismatch errors when using a newer compiler than CUDA officially supports.
143+
# This is needed to build with VS2022 17.11+ and CUDA < 12.4.
144144
if (MSVC_VERSION VERSION_GREATER_EQUAL 1941)
145145
string(APPEND CMAKE_CUDA_FLAGS " -D_ALLOW_COMPILER_AND_STL_VERSION_MISMATCH")
146146
endif()
147-
148-
# VS2026 (MSVC 1950+): may need _ENABLE_EXTENDED_ALIGNED_STORAGE if CUDA headers
149-
# use aligned_storage with extended alignment. This is independent of C++ standard.
150-
# Commented out to verify if CMAKE_CUDA_STANDARD 17 alone is sufficient.
151-
# if (MSVC_VERSION VERSION_GREATER_EQUAL 1950)
152-
# string(APPEND CMAKE_CUDA_FLAGS " -D_ENABLE_EXTENDED_ALIGNED_STORAGE")
153-
# endif()
154147
endif()
155148

156149
enable_language(CUDA) # This will fail if CUDA is not found

0 commit comments

Comments
 (0)