Disable RTTI when building unit tests. This avoids errors at link time.

llvm-svn: 123377
This commit is contained in:
Oscar Fuentes 2011-01-13 15:31:45 +00:00
parent f8e26b123c
commit b7c43b8c59
1 changed files with 6 additions and 0 deletions

View File

@ -18,6 +18,12 @@ add_custom_target(UnitTests)
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()