diff options
author | Brad King <brad.king@kitware.com> | 2020-05-26 12:25:16 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-05-26 12:25:23 (GMT) |
commit | 2ecb8698b77d9dce25a98ace0ab97d250ea3eb4d (patch) | |
tree | 754424f920bd4546691c687ed067d013965c2872 | |
parent | b6d9c3e459ba6b58d3e21296c7c6eddfd0dceb39 (diff) | |
parent | 80d37167fed1178872d28cbcbf57c7a3660bf244 (diff) | |
download | CMake-2ecb8698b77d9dce25a98ace0ab97d250ea3eb4d.zip CMake-2ecb8698b77d9dce25a98ace0ab97d250ea3eb4d.tar.gz CMake-2ecb8698b77d9dce25a98ace0ab97d250ea3eb4d.tar.bz2 |
Merge topic 'cuda-clang-pthreads'
80d37167fe Find{Threads,MPI}: Add support for CUDA with Clang
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Raul Tambre <raul@tambre.ee>
Merge-request: !4781
-rw-r--r-- | Modules/FindMPI.cmake | 2 | ||||
-rw-r--r-- | Modules/FindThreads.cmake | 4 |
2 files changed, 3 insertions, 3 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) diff --git a/Modules/FindThreads.cmake b/Modules/FindThreads.cmake index f97e5c8..ee49867 100644 --- a/Modules/FindThreads.cmake +++ b/Modules/FindThreads.cmake @@ -238,8 +238,8 @@ if(THREADS_FOUND AND NOT TARGET Threads::Threads) if(THREADS_HAVE_PTHREAD_ARG) set_property(TARGET Threads::Threads - PROPERTY INTERFACE_COMPILE_OPTIONS "$<$<COMPILE_LANGUAGE:CUDA>:SHELL:-Xcompiler -pthread>" - "$<$<NOT:$<COMPILE_LANGUAGE:CUDA>>:-pthread>") + PROPERTY INTERFACE_COMPILE_OPTIONS "$<$<COMPILE_LANG_AND_ID:CUDA,NVIDIA>:SHELL:-Xcompiler -pthread>" + "$<$<NOT:$<COMPILE_LANG_AND_ID:CUDA,NVIDIA>>:-pthread>") endif() if(CMAKE_THREAD_LIBS_INIT) |