[llvm-commits] [llvm] r123377 - /llvm/trunk/unittests/CMakeLists.txt
Oscar Fuentes
ofv at wanadoo.es
Thu Jan 13 07:31:45 PST 2011
Author: ofv
Date: Thu Jan 13 09:31:45 2011
New Revision: 123377
URL: http://llvm.org/viewvc/llvm-project?rev=123377&view=rev
Log:
Disable RTTI when building unit tests. This avoids errors at link time.
Modified:
llvm/trunk/unittests/CMakeLists.txt
Modified: llvm/trunk/unittests/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/CMakeLists.txt?rev=123377&r1=123376&r2=123377&view=diff
==============================================================================
--- llvm/trunk/unittests/CMakeLists.txt (original)
+++ llvm/trunk/unittests/CMakeLists.txt Thu Jan 13 09:31:45 2011
@@ -18,6 +18,12 @@
include_directories(${LLVM_MAIN_SRC_DIR}/utils/unittest/googletest/include)
add_definitions(-DGTEST_HAS_RTTI=0)
+if( CMAKE_COMPILER_IS_GNUCXX )
+ llvm_replace_compiler_option(CMAKE_CXX_FLAGS "-frtti" "-fno-rtti")
+elseif( MSVC )
+ llvm_replace_compiler_option(CMAKE_CXX_FLAGS "/GR" "/GR-")
+endif()
+
if (NOT LLVM_ENABLE_THREADS)
add_definitions(-DGTEST_HAS_PTHREAD=0)
endif()
More information about the llvm-commits
mailing list