File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -65,7 +65,10 @@ function (add_flangrt_library name)
65
65
set_target_properties (${name} PROPERTIES FOLDER "Fortran Runtime/Libraries" )
66
66
endif ()
67
67
68
+ # Minimum required C++ version for Flang-RT, even if CMAKE_CXX_STANDARD is defined to something else.
68
69
target_compile_features (${name} PRIVATE cxx_std_17 )
70
+
71
+ # Use compiler-specific options to disable exceptions and RTTI.
69
72
if (LLVM_COMPILER_IS_GCC_COMPATIBLE )
70
73
target_compile_options (${name} PRIVATE
71
74
$< $< COMPILE_LANGUAGE:CXX> :-fno-exceptions -fno-rtti -fno-unwind-tables -fno-asynchronous-unwind-tables>
@@ -80,6 +83,19 @@ function (add_flangrt_library name)
80
83
)
81
84
endif ()
82
85
86
+ # Also for CUDA source when compiling with FLANG_RT_EXPERIMENTAL_OFFLOAD_SUPPORT=CUDA
87
+ if (CMAKE_CUDA_COMPILER_ID MATCHES "NVIDIA" )
88
+ # Assuming gcc as host compiler.
89
+ target_compile_options (${name} PRIVATE
90
+ $< $< COMPILE_LANGUAGE:CUDA> :--no-exceptions -Xcompiler -fno-rtti -Xcompiler -fno-unwind-tables -Xcompiler -fno-asynchronous-unwind-tables>
91
+ )
92
+ else ()
93
+ # Assuming a clang-compatible CUDA compiler.
94
+ target_compile_options (${name} PRIVATE
95
+ $< $< COMPILE_LANGUAGE:CUDA> :-fno-exceptions -fno-rtti -fno-unwind-tables -fno-asynchronous-unwind-tables>
96
+ )
97
+ endif ()
98
+
83
99
# Flang-rt's public headers
84
100
target_include_directories (${name} PRIVATE "${FLANG_RT_SOURCE_DIR} /include" )
85
101
You can’t perform that action at this time.
0 commit comments