summaryrefslogtreecommitdiffstats
path: root/Modules/FindMPI.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-10-26 13:21:37 (GMT)
committerKitware Robot <kwrobot@kitware.com>2018-10-26 13:21:46 (GMT)
commit7033a7794259a26dca96451a30d43fbacea20f89 (patch)
treee47ba2f2a53d4b09797f32a032766bc97eb7e19f /Modules/FindMPI.cmake
parente07f147377b73c2d88a6921988c197c3e6a0150e (diff)
parente2d54e5c40c517698c856b6802b51e0c09d5dca6 (diff)
downloadCMake-7033a7794259a26dca96451a30d43fbacea20f89.zip
CMake-7033a7794259a26dca96451a30d43fbacea20f89.tar.gz
CMake-7033a7794259a26dca96451a30d43fbacea20f89.tar.bz2
Merge topic 'FindMPI-pthread-cuda'
e2d54e5c40 FindMPI: Pass -pthread to CUDA compiler through -Xcompiler Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Robert Maynard <robert.maynard@kitware.com> Merge-request: !2529
Diffstat (limited to 'Modules/FindMPI.cmake')
-rw-r--r--Modules/FindMPI.cmake7
1 files changed, 6 insertions, 1 deletions
diff --git a/Modules/FindMPI.cmake b/Modules/FindMPI.cmake
index 90c5592..8c45a8c 100644
--- a/Modules/FindMPI.cmake
+++ b/Modules/FindMPI.cmake
@@ -1132,7 +1132,12 @@ macro(_MPI_create_imported_target LANG)
add_library(MPI::MPI_${LANG} INTERFACE IMPORTED)
endif()
- set_property(TARGET MPI::MPI_${LANG} PROPERTY INTERFACE_COMPILE_OPTIONS "${MPI_${LANG}_COMPILE_OPTIONS}")
+ # When this is consumed for compiling CUDA, use '-Xcompiler' to wrap '-pthread'.
+ string(REPLACE "-pthread" "$<$<COMPILE_LANGUAGE:CUDA>: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)
+
set_property(TARGET MPI::MPI_${LANG} PROPERTY INTERFACE_COMPILE_DEFINITIONS "${MPI_${LANG}_COMPILE_DEFINITIONS}")
set_property(TARGET MPI::MPI_${LANG} PROPERTY INTERFACE_LINK_LIBRARIES "")