[llvm-commits] [PATCH] CMake unittests should compile without RTTI
Óscar Fuentes
ofv at wanadoo.es
Thu Jan 13 07:36:22 PST 2011
NAKAMURA Takumi <geek4civic at gmail.com> writes:
> I have yet another patch for the issue. Attached.
I just committed a fix based on Frits' proposal. Comments on yours
follow.
> 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.
AFAIK the Windows cmake buildbot does not do tests.
> --- 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 ()
> +
-pentantic and -Wno-long-long are controlled by the option
LLVM_ENABLE_PEDANTIC. See the top level CMakeLists.txt
> 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 )
Why do you need this?
More information about the llvm-commits
mailing list