summaryrefslogtreecommitdiff
path: root/cmake/modules/LLVMProcessSources.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/modules/LLVMProcessSources.cmake')
-rw-r--r--cmake/modules/LLVMProcessSources.cmake13
1 files changed, 13 insertions, 0 deletions
diff --git a/cmake/modules/LLVMProcessSources.cmake b/cmake/modules/LLVMProcessSources.cmake
index b753735cd5..a71c6f2af8 100644
--- a/cmake/modules/LLVMProcessSources.cmake
+++ b/cmake/modules/LLVMProcessSources.cmake
@@ -36,6 +36,19 @@ function(llvm_process_sources OUT_VAR)
add_td_sources(sources)
add_header_files(sources)
endif()
+
+ # Set common compiler options:
+ if( NOT LLVM_REQUIRES_EH )
+ if( CMAKE_COMPILER_IS_GNUCXX )
+ add_definitions( -fno-exceptions )
+ endif()
+ endif()
+ if( NOT LLVM_REQUIRES_RTTI )
+ if( CMAKE_COMPILER_IS_GNUCXX )
+ add_definitions( -fno-rtti )
+ endif()
+ endif()
+
set( ${OUT_VAR} ${sources} PARENT_SCOPE )
endfunction(llvm_process_sources)