summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAxel Huebl <axel.huebl@plasma.ninja>2020-07-03 06:18:05 (GMT)
committerBrad King <brad.king@kitware.com>2020-07-06 13:37:11 (GMT)
commitb725a190728626380b3bac45c8e92c09631aa8b4 (patch)
tree0a94af006189785a4966242a84d172ae708c2ea6
parent1e26c84b96c0ec6887de2cf5e14061ccb83bdbfe (diff)
downloadCMake-b725a190728626380b3bac45c8e92c09631aa8b4.zip
CMake-b725a190728626380b3bac45c8e92c09631aa8b4.tar.gz
CMake-b725a190728626380b3bac45c8e92c09631aa8b4.tar.bz2
FindMPI: Deny -fexceptions from NVCC
Do not forward -fexceptions (set from MVAPICH2) to NVCC. Fixes: #18558
-rw-r--r--Modules/FindMPI.cmake4
1 files changed, 3 insertions, 1 deletions
diff --git a/Modules/FindMPI.cmake b/Modules/FindMPI.cmake
index 786bcc8..45c0eb0 100644
--- a/Modules/FindMPI.cmake
+++ b/Modules/FindMPI.cmake
@@ -1153,9 +1153,11 @@ macro(_MPI_create_imported_target LANG)
add_library(MPI::MPI_${LANG} INTERFACE IMPORTED)
endif()
- # When this is consumed for compiling CUDA, use '-Xcompiler' to wrap '-pthread'.
+ # When this is consumed for compiling CUDA, use '-Xcompiler' to wrap '-pthread' and '-fexceptions'.
string(REPLACE "-pthread" "$<$<COMPILE_LANG_AND_ID:CUDA,NVIDIA>:SHELL:-Xcompiler >-pthread"
_MPI_${LANG}_COMPILE_OPTIONS "${MPI_${LANG}_COMPILE_OPTIONS}")
+ string(REPLACE "-fexceptions" "$<$<COMPILE_LANG_AND_ID:CUDA,NVIDIA>:SHELL:-Xcompiler >-fexceptions"
+ _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)