summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-07-08 12:26:36 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-07-08 12:26:43 (GMT)
commit8cbd338217a256b4520695d91d502e283f9b8811 (patch)
tree99d1959fd95c32c75e92e547bf1e6e71e979a123 /Modules
parent1a930ec1f0d10e638fb498e2d98c81fa722cc4de (diff)
parent33192e1b5f1cc8cce95f4d69cf7ecf0b6269f84b (diff)
downloadCMake-8cbd338217a256b4520695d91d502e283f9b8811.zip
CMake-8cbd338217a256b4520695d91d502e283f9b8811.tar.gz
CMake-8cbd338217a256b4520695d91d502e283f9b8811.tar.bz2
Merge topic 'FindMPI-nvcc-link-pthread'
33192e1b5f FindMPI: Pass -pthread to NVCC through -Xlinker for device linking Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4981
Diffstat (limited to 'Modules')
-rw-r--r--Modules/FindMPI.cmake2
1 files changed, 2 insertions, 0 deletions
diff --git a/Modules/FindMPI.cmake b/Modules/FindMPI.cmake
index 45c0eb0..25de562 100644
--- a/Modules/FindMPI.cmake
+++ b/Modules/FindMPI.cmake
@@ -1164,6 +1164,8 @@ macro(_MPI_create_imported_target LANG)
set_property(TARGET MPI::MPI_${LANG} PROPERTY INTERFACE_COMPILE_DEFINITIONS "${MPI_${LANG}_COMPILE_DEFINITIONS}")
if(MPI_${LANG}_LINK_FLAGS)
+ string(REPLACE "-pthread" "$<$<LINK_LANG_AND_ID:CUDA,NVIDIA>:-Xlinker >-pthread"
+ _MPI_${LANG}_LINK_FLAGS "${MPI_${LANG}_LINK_FLAGS}")
set_property(TARGET MPI::MPI_${LANG} PROPERTY INTERFACE_LINK_OPTIONS "SHELL:${MPI_${LANG}_LINK_FLAGS}")
endif()
# If the compiler links MPI implicitly, no libraries will be found as they're contained within