summaryrefslogtreecommitdiff
path: root/Modules/FindMPI.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-07-07 13:13:38 +0000
committerKitware Robot <kwrobot@kitware.com>2020-07-07 09:13:49 -0400
commit996b312825524b7e4595742b4892ba2a99e9536f (patch)
treee1b8a96cad5e575b5aa3ec9922597c433173f65f /Modules/FindMPI.cmake
parent2e029b1d360261f2fd8cdd06605149a87af77848 (diff)
parentb725a190728626380b3bac45c8e92c09631aa8b4 (diff)
downloadcmake-996b312825524b7e4595742b4892ba2a99e9536f.tar.gz
Merge topic 'FindMPI-nvcc-fexceptions' into release-3.18
b725a19072 FindMPI: Deny -fexceptions from NVCC Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Robert Maynard <robert.maynard@kitware.com> Merge-request: !4970
Diffstat (limited to 'Modules/FindMPI.cmake')
-rw-r--r--Modules/FindMPI.cmake4
1 files changed, 3 insertions, 1 deletions
diff --git a/Modules/FindMPI.cmake b/Modules/FindMPI.cmake
index 786bcc8742..45c0eb0112 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)