[llvm-commits] [PATCH] CMake unittests should compile without RTTI
NAKAMURA Takumi
geek4civic at gmail.com
Thu Jan 13 07:54:00 PST 2011
Good midnight, Oscar!
2011/1/14 Óscar Fuentes <ofv at wanadoo.es>:
> AFAIK the Windows cmake buildbot does not do tests.
IIRC, just before clang-msvc had died, Daniel had enabled llvm's
"check". Then it reported several (and I expected then) failures.
Unittests might be executed then.
I am working for Windows x64. It is because I would like to brush up
llvm win64 tests.
>> +# 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
Oh excuse me! It was copypasted from clang/CMakeLists.txt!
It would not needed for this issue.
I forgot to exclude it. Then I tried tweaking unittest issue.
>> --- 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?
I don't know reason why. :(
Without this hack, I had seen several
"-fno-exceptions -fno-exceptions -fno-exceptions ..." and CMake would
not add "-fno-rtti",
on (homebrew) cmake-2.8.2 on linux.
I have not yet evaluated this patch on Visual Studio.
(IIRC, cmake/mingw did not affected regardless of this patch, for me)
Thank you!
...Takumi
More information about the llvm-commits
mailing list