summaryrefslogtreecommitdiffstats
path: root/Modules/FindThreads.cmake
diff options
context:
space:
mode:
authorTobias Ribizel <ribizel@kit.edu>2020-05-22 23:15:35 (GMT)
committerBrad King <brad.king@kitware.com>2020-05-25 15:17:52 (GMT)
commit80d37167fed1178872d28cbcbf57c7a3660bf244 (patch)
tree4273849003e7b8b564f2563e7876214dd38a38f2 /Modules/FindThreads.cmake
parenta354b7f21e858728606ddc7c275bad35914d8eaa (diff)
downloadCMake-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/FindThreads.cmake')
-rw-r--r--Modules/FindThreads.cmake4
1 files changed, 2 insertions, 2 deletions
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)