Skip to content

Commit 17da4f6

Browse files
Update for VS2022 17.11 compatibility with CUDA < 12.4 (#1341)
* Update for VS2022 17.11 compatibility with CUDA < 12.4 * Try again
1 parent e467453 commit 17da4f6

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
@@ -69,6 +69,11 @@ if(BUILD_CUDA)
6969
# This needs to be added *before* we try to enable the CUDA language so CMake's compiler check passes.
7070
if(MSVC AND MSVC_VERSION VERSION_GREATER_EQUAL 1940)
7171
string(APPEND CMAKE_CUDA_FLAGS " --allow-unsupported-compiler")
72+
73+
# This is needed to build with VS2022 17.11+ and CUDA < 12.4.
74+
if (MSVC_VERSION VERSION_GREATER_EQUAL 1941)
75+
string(APPEND CMAKE_CUDA_FLAGS " -D_ALLOW_COMPILER_AND_STL_VERSION_MISMATCH")
76+
endif()
7277
endif()
7378

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

0 commit comments

Comments
 (0)