summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/cmake/modules/LLVMProcessSources.cmake13
-rw-r--r--llvm/examples/ExceptionDemo/CMakeLists.txt1
-rw-r--r--llvm/examples/Kaleidoscope/Chapter7/CMakeLists.txt1
-rw-r--r--llvm/lib/Support/CMakeLists.txt3
-rw-r--r--llvm/lib/System/CMakeLists.txt5
-rw-r--r--llvm/lib/VMCore/CMakeLists.txt2
-rw-r--r--llvm/utils/TableGen/CMakeLists.txt3
-rw-r--r--llvm/utils/unittest/CMakeLists.txt6
8 files changed, 34 insertions, 0 deletions
diff --git a/llvm/cmake/modules/LLVMProcessSources.cmake b/llvm/cmake/modules/LLVMProcessSources.cmake
index b753735cd55..a71c6f2af83 100644
--- a/llvm/cmake/modules/LLVMProcessSources.cmake
+++ b/llvm/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)
diff --git a/llvm/examples/ExceptionDemo/CMakeLists.txt b/llvm/examples/ExceptionDemo/CMakeLists.txt
index d6619155684..88c9ab7c181 100644
--- a/llvm/examples/ExceptionDemo/CMakeLists.txt
+++ b/llvm/examples/ExceptionDemo/CMakeLists.txt
@@ -1,4 +1,5 @@
set(LLVM_LINK_COMPONENTS jit nativecodegen)
+set(LLVM_REQUIRES_EH 1)
add_llvm_example(ExceptionDemo
ExceptionDemo.cpp
diff --git a/llvm/examples/Kaleidoscope/Chapter7/CMakeLists.txt b/llvm/examples/Kaleidoscope/Chapter7/CMakeLists.txt
index 9b8227c6934..da3839843bd 100644
--- a/llvm/examples/Kaleidoscope/Chapter7/CMakeLists.txt
+++ b/llvm/examples/Kaleidoscope/Chapter7/CMakeLists.txt
@@ -1,4 +1,5 @@
set(LLVM_LINK_COMPONENTS core jit interpreter native)
+set(LLVM_REQUIRES_RTTI 1)
add_llvm_example(Kaleidoscope-Ch7
toy.cpp
diff --git a/llvm/lib/Support/CMakeLists.txt b/llvm/lib/Support/CMakeLists.txt
index f7e02c9bc0a..c9c862ce84a 100644
--- a/llvm/lib/Support/CMakeLists.txt
+++ b/llvm/lib/Support/CMakeLists.txt
@@ -1,3 +1,6 @@
+## FIXME: This only requires RTTI because tblgen uses it. Fix that.
+set(LLVM_REQUIRES_RTTI 1)
+
add_llvm_library(LLVMSupport
APFloat.cpp
APInt.cpp
diff --git a/llvm/lib/System/CMakeLists.txt b/llvm/lib/System/CMakeLists.txt
index 5c15f8e9eba..ac2830e80a0 100644
--- a/llvm/lib/System/CMakeLists.txt
+++ b/llvm/lib/System/CMakeLists.txt
@@ -1,3 +1,8 @@
+set(LLVM_REQUIRES_RTTI 1)
+if( MINGW )
+ set(LLVM_REQUIRES_EH 1)
+endif()
+
add_llvm_library(LLVMSystem
Alarm.cpp
Atomic.cpp
diff --git a/llvm/lib/VMCore/CMakeLists.txt b/llvm/lib/VMCore/CMakeLists.txt
index 1388c93cce3..0ff260f060a 100644
--- a/llvm/lib/VMCore/CMakeLists.txt
+++ b/llvm/lib/VMCore/CMakeLists.txt
@@ -1,3 +1,5 @@
+set(LLVM_REQUIRES_RTTI 1)
+
add_llvm_library(LLVMCore
AsmWriter.cpp
Attributes.cpp
diff --git a/llvm/utils/TableGen/CMakeLists.txt b/llvm/utils/TableGen/CMakeLists.txt
index c748614479a..5bafcecc207 100644
--- a/llvm/utils/TableGen/CMakeLists.txt
+++ b/llvm/utils/TableGen/CMakeLists.txt
@@ -1,3 +1,6 @@
+set(LLVM_REQUIRES_EH 1)
+set(LLVM_REQUIRES_RTTI 1)
+
add_executable(tblgen
ARMDecoderEmitter.cpp
AsmMatcherEmitter.cpp
diff --git a/llvm/utils/unittest/CMakeLists.txt b/llvm/utils/unittest/CMakeLists.txt
index 4400b38234e..9d678edfd12 100644
--- a/llvm/utils/unittest/CMakeLists.txt
+++ b/llvm/utils/unittest/CMakeLists.txt
@@ -24,6 +24,12 @@ if(SUPPORTS_NO_VARIADIC_MACROS_FLAG)
add_definitions("-Wno-variadic-macros")
endif()
+set(LLVM_REQUIRES_RTTI 1)
+add_definitions( -DGTEST_HAS_RTTI=0 )
+# libstdc++'s TR1 <tuple> header depends on RTTI and uses C++'0x features not
+# supported by Clang, so force googletest to use its own tuple implementation.
+add_definitions( -DGTEST_USE_OWN_TR1_TUPLE )
+
add_llvm_library(gtest
googletest/gtest.cc
googletest/gtest-death-test.cc
OpenPOWER on IntegriCloud