[llvm-commits] [PATCH] CMake unittests should compile without RTTI

NAKAMURA Takumi geek4civic at gmail.com
Thu Jan 13 07:05:19 PST 2011


Hello Frits and Oscar,

I have yet another patch for the issue. Attached.


2011/1/13 Frits van Bommel <fvbommel at gmail.com>:
> By the way, are there no buildbots running CMake with unittests
> enabled? None of them seem to have failed over this...

Indeed, we might have at least one cmake-based buildbot on posix.


...Takumi
-------------- next part --------------
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -178,6 +178,11 @@ set(llvm_builded_incs_dir ${LLVM_BINARY_DIR}/include/llvm)
 
 include(AddLLVMDefinitions)
 
+# Add appropriate flags for GCC
+if (CMAKE_COMPILER_IS_GNUCXX)
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-common -Woverloaded-virtual -Wcast-qual -fno-strict-aliasing -pedantic -Wno-long-long -Wall -W -Wno-unused-parameter -Wwrite-strings")
+endif ()
+
 if(WIN32)
   if(CYGWIN)
     set(LLVM_ON_WIN32 0)
diff --git a/unittests/CMakeLists.txt b/unittests/CMakeLists.txt
index 61ea1ee..7ec7a21 100644
--- a/unittests/CMakeLists.txt
+++ b/unittests/CMakeLists.txt
@@ -12,6 +12,7 @@ function(add_llvm_unittest test_dirname)
   endif()
   add_llvm_executable(${test_name}Tests ${ARGN})
   add_dependencies(UnitTests ${test_name}Tests)
+  set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" PARENT_SCOPE )
 endfunction()
 
 add_custom_target(UnitTests)


More information about the llvm-commits mailing list