From b725a190728626380b3bac45c8e92c09631aa8b4 Mon Sep 17 00:00:00 2001 From: Axel Huebl Date: Thu, 2 Jul 2020 23:18:05 -0700 Subject: FindMPI: Deny -fexceptions from NVCC Do not forward -fexceptions (set from MVAPICH2) to NVCC. Fixes: #18558 --- Modules/FindMPI.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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" "$<$:SHELL:-Xcompiler >-pthread" _MPI_${LANG}_COMPILE_OPTIONS "${MPI_${LANG}_COMPILE_OPTIONS}") + string(REPLACE "-fexceptions" "$<$: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) -- cgit v0.12