[llvm-commits] [llvm] r116682 - in /llvm/trunk: cmake/modules/LLVMProcessSources.cmake examples/ExceptionDemo/CMakeLists.txt examples/Kaleidoscope/Chapter7/CMakeLists.txt lib/Support/CMakeLists.txt lib/System/CMakeLists.txt lib/VMCore/CMakeLists.txt utils/TableGen/CMakeLists.txt utils/unittest/CMakeLists.txt

Oscar Fuentes ofv at wanadoo.es
Sat Oct 16 19:26:16 PDT 2010


Author: ofv
Date: Sat Oct 16 21:26:16 2010
New Revision: 116682

URL: http://llvm.org/viewvc/llvm-project?rev=116682&view=rev
Log:
Build with RTTI and exceptions disabled. Only in GCC for now.

Modified:
    llvm/trunk/cmake/modules/LLVMProcessSources.cmake
    llvm/trunk/examples/ExceptionDemo/CMakeLists.txt
    llvm/trunk/examples/Kaleidoscope/Chapter7/CMakeLists.txt
    llvm/trunk/lib/Support/CMakeLists.txt
    llvm/trunk/lib/System/CMakeLists.txt
    llvm/trunk/lib/VMCore/CMakeLists.txt
    llvm/trunk/utils/TableGen/CMakeLists.txt
    llvm/trunk/utils/unittest/CMakeLists.txt

Modified: llvm/trunk/cmake/modules/LLVMProcessSources.cmake
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/LLVMProcessSources.cmake?rev=116682&r1=116681&r2=116682&view=diff
==============================================================================
--- llvm/trunk/cmake/modules/LLVMProcessSources.cmake (original)
+++ llvm/trunk/cmake/modules/LLVMProcessSources.cmake Sat Oct 16 21:26:16 2010
@@ -36,6 +36,19 @@
     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)
 

Modified: llvm/trunk/examples/ExceptionDemo/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/examples/ExceptionDemo/CMakeLists.txt?rev=116682&r1=116681&r2=116682&view=diff
==============================================================================
--- llvm/trunk/examples/ExceptionDemo/CMakeLists.txt (original)
+++ llvm/trunk/examples/ExceptionDemo/CMakeLists.txt Sat Oct 16 21:26:16 2010
@@ -1,4 +1,5 @@
 set(LLVM_LINK_COMPONENTS jit nativecodegen)
+set(LLVM_REQUIRES_EH 1)
 
 add_llvm_example(ExceptionDemo
   ExceptionDemo.cpp

Modified: llvm/trunk/examples/Kaleidoscope/Chapter7/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/examples/Kaleidoscope/Chapter7/CMakeLists.txt?rev=116682&r1=116681&r2=116682&view=diff
==============================================================================
--- llvm/trunk/examples/Kaleidoscope/Chapter7/CMakeLists.txt (original)
+++ llvm/trunk/examples/Kaleidoscope/Chapter7/CMakeLists.txt Sat Oct 16 21:26:16 2010
@@ -1,4 +1,5 @@
 set(LLVM_LINK_COMPONENTS core jit interpreter native)
+set(LLVM_REQUIRES_RTTI 1)
 
 add_llvm_example(Kaleidoscope-Ch7
   toy.cpp

Modified: llvm/trunk/lib/Support/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/CMakeLists.txt?rev=116682&r1=116681&r2=116682&view=diff
==============================================================================
--- llvm/trunk/lib/Support/CMakeLists.txt (original)
+++ llvm/trunk/lib/Support/CMakeLists.txt Sat Oct 16 21:26:16 2010
@@ -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

Modified: llvm/trunk/lib/System/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/System/CMakeLists.txt?rev=116682&r1=116681&r2=116682&view=diff
==============================================================================
--- llvm/trunk/lib/System/CMakeLists.txt (original)
+++ llvm/trunk/lib/System/CMakeLists.txt Sat Oct 16 21:26:16 2010
@@ -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

Modified: llvm/trunk/lib/VMCore/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/CMakeLists.txt?rev=116682&r1=116681&r2=116682&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/CMakeLists.txt (original)
+++ llvm/trunk/lib/VMCore/CMakeLists.txt Sat Oct 16 21:26:16 2010
@@ -1,3 +1,5 @@
+set(LLVM_REQUIRES_RTTI 1)
+
 add_llvm_library(LLVMCore
   AsmWriter.cpp
   Attributes.cpp

Modified: llvm/trunk/utils/TableGen/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CMakeLists.txt?rev=116682&r1=116681&r2=116682&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/CMakeLists.txt (original)
+++ llvm/trunk/utils/TableGen/CMakeLists.txt Sat Oct 16 21:26:16 2010
@@ -1,3 +1,6 @@
+set(LLVM_REQUIRES_EH 1)
+set(LLVM_REQUIRES_RTTI 1)
+
 add_executable(tblgen
   ARMDecoderEmitter.cpp
   AsmMatcherEmitter.cpp

Modified: llvm/trunk/utils/unittest/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/unittest/CMakeLists.txt?rev=116682&r1=116681&r2=116682&view=diff
==============================================================================
--- llvm/trunk/utils/unittest/CMakeLists.txt (original)
+++ llvm/trunk/utils/unittest/CMakeLists.txt Sat Oct 16 21:26:16 2010
@@ -24,6 +24,12 @@
   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





More information about the llvm-commits mailing list