summaryrefslogtreecommitdiffstats
path: root/llvm/cmake/modules/AddLLVM.cmake
diff options
context:
space:
mode:
authorDan Liew <dan@su-root.co.uk>2014-07-22 15:41:18 +0000
committerDan Liew <dan@su-root.co.uk>2014-07-22 15:41:18 +0000
commita5bdc846aa62215dab94630f5854acef0f080b27 (patch)
treeb6fd5897d61aef157534a07b58defe224578ad10 /llvm/cmake/modules/AddLLVM.cmake
parent521237cad6b82e8f8bd340410e275474672838ba (diff)
downloadbcm5719-llvm-a5bdc846aa62215dab94630f5854acef0f080b27.tar.gz
bcm5719-llvm-a5bdc846aa62215dab94630f5854acef0f080b27.zip
Added LLVM_ENABLE_RTTI and LLVM_ENABLE_EH options that allow RTTI and EH
to globally be controlled. Individual targets (e.g. ExceptionDemo) can still override this by using LLVM_REQUIRE_RTTI and LLVM_REQUIRE_EH if they need to be compiled with RTTI or exception handling respectively. llvm-svn: 213663
Diffstat (limited to 'llvm/cmake/modules/AddLLVM.cmake')
-rw-r--r--llvm/cmake/modules/AddLLVM.cmake13
1 files changed, 10 insertions, 3 deletions
diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake
index 81efae62e79..409a5d61e65 100644
--- a/llvm/cmake/modules/AddLLVM.cmake
+++ b/llvm/cmake/modules/AddLLVM.cmake
@@ -8,8 +8,13 @@ function(llvm_update_compile_flags name)
set(update_src_props ON)
endif()
- if(LLVM_REQUIRES_EH)
- set(LLVM_REQUIRES_RTTI ON)
+ # LLVM_REQUIRES_EH is an internal flag that individual
+ # targets can use to force EH
+ if(LLVM_REQUIRES_EH OR LLVM_ENABLE_EH)
+ if(NOT (LLVM_REQUIRES_RTTI OR LLVM_ENABLE_RTTI))
+ message(AUTHOR_WARNING "Exception handling requires RTTI. Enabling RTTI for ${name}")
+ set(LLVM_REQUIRES_RTTI ON)
+ endif()
else()
if(LLVM_COMPILER_IS_GCC_COMPATIBLE)
list(APPEND LLVM_COMPILE_FLAGS "-fno-exceptions")
@@ -19,7 +24,9 @@ function(llvm_update_compile_flags name)
endif()
endif()
- if(NOT LLVM_REQUIRES_RTTI)
+ # LLVM_REQUIRES_RTTI is an internal flag that individual
+ # targets can use to force RTTI
+ if(NOT (LLVM_REQUIRES_RTTI OR LLVM_ENABLE_RTTI))
list(APPEND LLVM_COMPILE_DEFINITIONS GTEST_HAS_RTTI=0)
if (LLVM_COMPILER_IS_GCC_COMPATIBLE)
list(APPEND LLVM_COMPILE_FLAGS "-fno-rtti")
OpenPOWER on IntegriCloud