summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-10-25 14:48:14 (GMT)
committerBrad King <brad.king@kitware.com>2018-10-25 14:48:14 (GMT)
commite1dc842cc1dd761c802d802211160e72d751e146 (patch)
tree8f06ed4aff38a138816747e53762f4488acb63e3 /Modules
parent44cc305ac12d58fe476f815b89f42288455e44a9 (diff)
parente2d54e5c40c517698c856b6802b51e0c09d5dca6 (diff)
downloadCMake-e1dc842cc1dd761c802d802211160e72d751e146.zip
CMake-e1dc842cc1dd761c802d802211160e72d751e146.tar.gz
CMake-e1dc842cc1dd761c802d802211160e72d751e146.tar.bz2
Merge branch 'FindMPI-pthread-cuda' into release-3.13
Merge-request: !2529
Diffstat (limited to 'Modules')
-rw-r--r--Modules/FindMPI.cmake7
1 files changed, 6 insertions, 1 deletions
diff --git a/Modules/FindMPI.cmake b/Modules/FindMPI.cmake
index bfcd876..b94e69e 100644
--- a/Modules/FindMPI.cmake
+++ b/Modules/FindMPI.cmake
@@ -1131,7 +1131,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 "")