diff options
author | Tobias Ribizel <ribizel@kit.edu> | 2020-05-22 23:15:35 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-05-25 15:17:52 (GMT) |
commit | 80d37167fed1178872d28cbcbf57c7a3660bf244 (patch) | |
tree | 4273849003e7b8b564f2563e7876214dd38a38f2 /Modules/FindMPI.cmake | |
parent | a354b7f21e858728606ddc7c275bad35914d8eaa (diff) | |
download | CMake-80d37167fed1178872d28cbcbf57c7a3660bf244.zip CMake-80d37167fed1178872d28cbcbf57c7a3660bf244.tar.gz CMake-80d37167fed1178872d28cbcbf57c7a3660bf244.tar.bz2 |
Find{Threads,MPI}: Add support for CUDA with Clang
Currently CMake passes `-Xcompiler -pthread` flags to CUDA compilers
irrespective of the actual CUDA compiler ID. This makes sure the
additional `-Xcompiler` flag is only used with nvcc.
Diffstat (limited to 'Modules/FindMPI.cmake')
-rw-r--r-- | Modules/FindMPI.cmake | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/FindMPI.cmake b/Modules/FindMPI.cmake index e9b6bd2..786bcc8 100644 --- a/Modules/FindMPI.cmake +++ b/Modules/FindMPI.cmake @@ -1154,7 +1154,7 @@ macro(_MPI_create_imported_target LANG) endif() # When this is consumed for compiling CUDA, use '-Xcompiler' to wrap '-pthread'. - string(REPLACE "-pthread" "$<$<COMPILE_LANGUAGE:CUDA>:SHELL:-Xcompiler >-pthread" + string(REPLACE "-pthread" "$<$<COMPILE_LANG_AND_ID:CUDA,NVIDIA>:SHELL:-Xcompiler >-pthread" _MPI_${LANG}_COMPILE_OPTIONS "${MPI_${LANG}_COMPILE_OPTIONS}") set_property(TARGET MPI::MPI_${LANG} PROPERTY INTERFACE_COMPILE_OPTIONS "${_MPI_${LANG}_COMPILE_OPTIONS}") unset(_MPI_${LANG}_COMPILE_OPTIONS) |