diff options
-rw-r--r-- | cmake/modules/LLVMProcessSources.cmake | 13 | ||||
-rw-r--r-- | examples/ExceptionDemo/CMakeLists.txt | 1 | ||||
-rw-r--r-- | examples/Kaleidoscope/Chapter7/CMakeLists.txt | 1 | ||||
-rw-r--r-- | lib/Support/CMakeLists.txt | 3 | ||||
-rw-r--r-- | lib/System/CMakeLists.txt | 5 | ||||
-rw-r--r-- | lib/VMCore/CMakeLists.txt | 2 | ||||
-rw-r--r-- | utils/TableGen/CMakeLists.txt | 3 | ||||
-rw-r--r-- | utils/unittest/CMakeLists.txt | 6 |
8 files changed, 34 insertions, 0 deletions
diff --git a/cmake/modules/LLVMProcessSources.cmake b/cmake/modules/LLVMProcessSources.cmake index b753735..a71c6f2 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) diff --git a/examples/ExceptionDemo/CMakeLists.txt b/examples/ExceptionDemo/CMakeLists.txt index d661915..88c9ab7 100644 --- a/examples/ExceptionDemo/CMakeLists.txt +++ b/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/examples/Kaleidoscope/Chapter7/CMakeLists.txt b/examples/Kaleidoscope/Chapter7/CMakeLists.txt index 9b8227c..da38398 100644 --- a/examples/Kaleidoscope/Chapter7/CMakeLists.txt +++ b/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/lib/Support/CMakeLists.txt b/lib/Support/CMakeLists.txt index f7e02c9..c9c862c 100644 --- a/lib/Support/CMakeLists.txt +++ b/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/lib/System/CMakeLists.txt b/lib/System/CMakeLists.txt index 5c15f8e..ac2830e 100644 --- a/lib/System/CMakeLists.txt +++ b/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/lib/VMCore/CMakeLists.txt b/lib/VMCore/CMakeLists.txt index 1388c93..0ff260f 100644 --- a/lib/VMCore/CMakeLists.txt +++ b/lib/VMCore/CMakeLists.txt @@ -1,3 +1,5 @@ +set(LLVM_REQUIRES_RTTI 1) + add_llvm_library(LLVMCore AsmWriter.cpp Attributes.cpp diff --git a/utils/TableGen/CMakeLists.txt b/utils/TableGen/CMakeLists.txt index c748614..5bafcec 100644 --- a/utils/TableGen/CMakeLists.txt +++ b/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/utils/unittest/CMakeLists.txt b/utils/unittest/CMakeLists.txt index 4400b38..9d678ed 100644 --- a/utils/unittest/CMakeLists.txt +++ b/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 |