summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-04-02 11:53:33 (GMT)
committerKitware Robot <kwrobot@kitware.com>2021-04-02 11:53:41 (GMT)
commit7ce67efda45747b7988309d75988d09bdeabd7ee (patch)
tree8a6c3eada0cef50479e91139d71e51dfdb78931c
parent55843b899ed1ef52e3c4746ae98c3c4a396760c1 (diff)
parent666f689e48c15c3d0bd524b43beb62dd16790ace (diff)
downloadCMake-7ce67efda45747b7988309d75988d09bdeabd7ee.zip
CMake-7ce67efda45747b7988309d75988d09bdeabd7ee.tar.gz
CMake-7ce67efda45747b7988309d75988d09bdeabd7ee.tar.bz2
Merge topic 'FindMPI-host_link'
666f689e48 FindMPI: avoid host link options to be propagated to device link step Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Robert Maynard <robertjmaynard@gmail.com> Acked-by: Alex <leha-bot@yandex.ru> Merge-request: !5966
-rw-r--r--Modules/FindMPI.cmake7
1 files changed, 4 insertions, 3 deletions
diff --git a/Modules/FindMPI.cmake b/Modules/FindMPI.cmake
index bea0d8d..c48decb 100644
--- a/Modules/FindMPI.cmake
+++ b/Modules/FindMPI.cmake
@@ -1187,9 +1187,10 @@ 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}")
+ string(REPLACE "," "$<COMMA>" _MPI_${LANG}_LINK_FLAGS "${MPI_${LANG}_LINK_FLAGS}")
+ string(PREPEND _MPI_${LANG}_LINK_FLAGS "$<HOST_LINK:SHELL:")
+ string(APPEND _MPI_${LANG}_LINK_FLAGS ">")
+ set_property(TARGET MPI::MPI_${LANG} PROPERTY INTERFACE_LINK_OPTIONS "${_MPI_${LANG}_LINK_FLAGS}")
endif()
# If the compiler links MPI implicitly, no libraries will be found as they're contained within
# CMAKE_<LANG>_IMPLICIT_LINK_LIBRARIES already.