Skip to content

Commit

Permalink
Update for VS2022 17.11 compatibility with CUDA < 12.4 (#1341)
Browse files Browse the repository at this point in the history
* Update for VS2022 17.11 compatibility with CUDA < 12.4

* Try again
  • Loading branch information
matthewdouglas authored Sep 9, 2024
1 parent e467453 commit 17da4f6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ if(BUILD_CUDA)
# This needs to be added *before* we try to enable the CUDA language so CMake's compiler check passes.
if(MSVC AND MSVC_VERSION VERSION_GREATER_EQUAL 1940)
string(APPEND CMAKE_CUDA_FLAGS " --allow-unsupported-compiler")

# This is needed to build with VS2022 17.11+ and CUDA < 12.4.
if (MSVC_VERSION VERSION_GREATER_EQUAL 1941)
string(APPEND CMAKE_CUDA_FLAGS " -D_ALLOW_COMPILER_AND_STL_VERSION_MISMATCH")
endif()
endif()

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

0 comments on commit 17da4f6

Please sign in to comment.