[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.

Michael Spencer bigcheesegs at gmail.com
Tue Oct 19 10:39:55 PDT 2010


On Sat, Oct 16, 2010 at 10:26 PM, Oscar Fuentes <ofv at wanadoo.es> wrote:
> 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 )

This breaks the build on VS2010. I handle tuple header selection
inside the header files where I actually have access to the compiler
version and other assorted macros needed to figure this out.

- Michael Spencer

> +
>  add_llvm_library(gtest
>   googletest/gtest.cc
>   googletest/gtest-death-test.cc
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>




More information about the llvm-commits mailing list