Skip to content

Commit 0d3d977

Browse files
matthewdouglasTitus-von-Koeller
authored andcommitted
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 e8881be commit 0d3d977

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
@@ -82,6 +82,11 @@ if(BUILD_CUDA)
8282
# This needs to be added *before* we try to enable the CUDA language so CMake's compiler check passes.
8383
if(MSVC AND MSVC_VERSION VERSION_GREATER_EQUAL 1940)
8484
string(APPEND CMAKE_CUDA_FLAGS " --allow-unsupported-compiler")
85+
86+
# This is needed to build with VS2022 17.11+ and CUDA < 12.4.
87+
if (MSVC_VERSION VERSION_GREATER_EQUAL 1941)
88+
string(APPEND CMAKE_CUDA_FLAGS " -D_ALLOW_COMPILER_AND_STL_VERSION_MISMATCH")
89+
endif()
8590
endif()
8691

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

0 commit comments

Comments
 (0)