Skip to content

Commit

Permalink
if CMAKE_CUDA_HOST_COMPILER is not set, set it to CMAKE_CXX_COMPILER …
Browse files Browse the repository at this point in the history
…in case it's not in PATH
  • Loading branch information
evaleev committed Jun 25, 2024
1 parent b9b663a commit d2dd697
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions external/cuda.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ if (DEFINED CMAKE_CUDA_FLAGS)
else()
set(CMAKE_CUDA_FLAGS "--expt-relaxed-constexpr")
endif()
# if CMAKE_CUDA_HOST_COMPILER not set, set it to CMAKE_CXX_COMPILER, else NVCC will grab something from PATH
if (NOT DEFINED CMAKE_CUDA_HOST_COMPILER)
set(CMAKE_CUDA_HOST_COMPILER "${CMAKE_CXX_COMPILER}" CACHE STRING "The host C++ compiler to be used by the CUDA compiler")
endif()

enable_language(CUDA)

set(CUDA_FOUND TRUE)
Expand Down

0 comments on commit d2dd697

Please sign in to comment.