mirror of
https://github.com/Kitware/CMake.git
synced 2025-12-31 10:50:16 -06:00
FindMPI: Pass -pthread to NVCC through -Xlinker for device linking
Fixes: #20924
This commit is contained in:
committed by
Brad King
parent
996b312825
commit
33192e1b5f
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user