[llvm-commits] [llvm] r117646 - /llvm/trunk/unittests/CMakeLists.txt

Michael Spencer bigcheesegs at gmail.com
Sat Oct 30 10:00:06 PDT 2010


On Sat, Oct 30, 2010 at 12:48 PM, Óscar Fuentes <ofv at wanadoo.es> wrote:
> NAKAMURA Takumi <geek4civic at gmail.com> writes:
>
>>> On which platform/compiler the link fails?
>>
>> I met this issue on x86_64-linux CentOS5 gcc-4.4.
>> After the last commit, I found the issue closed.
>>
>>   Bug 8428 - Unable to link JITTests
>>   http://llvm.org/bugs/show_bug.cgi?id=8428
>
> I work on Kubuntu 10.10 x86_64 gcc-4.4.5 and didn't hit the problem, but
> maybe I was using the wrong revision.
>
>> With my change, I confirmed msvs8, msvs10 and mingw builds are not broken.
>> Lemme know if I broke anything.
>>
>>> Unless it was changed on the
>>> last days, the config&make build sets REQUIRE_RTTI.
>>
>> Excuse me, I don't understand what you say exactly.
>
> The LLVM_REQUIRE_RTTI variable is the CMake equivalent of Makefile's
> REQUIRE_RTTI variable.
>
> r116834 stablished LLVM_REQUIRE_RTTI to 1 on unittests/CMakeLists.txt:
>
> commit 1ac44a341aecac2c5329957bbe72487a3ad8aa14
> Author: mspencer
> Date:   Tue Oct 19 18:04:19 2010 +0000
>
>    unittests: Use the correct defines and global variables when building on CMake.
>
>    git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116834 91177308-0d34-0410-b5e6-96231b3b80d8
>
> --- a/unittests/CMakeLists.txt
> +++ b/unittests/CMakeLists.txt
> @@ -13,6 +13,8 @@ function(add_llvm_unittest test_name)
>  endfunction()
>
>  include_directories(${LLVM_MAIN_SRC_DIR}/utils/unittest/googletest/include)
> +set(LLVM_REQUIRES_RTTI 1)
> +add_definitions(-DGTEST_HAS_RTTI=0)
>
>  set(LLVM_LINK_COMPONENTS
>   jit
>
>
> I asked for a clarification about the purpose of that change, with no luck.

I made this change because you changed utils/unittest/CMakeLists.txt.
They must remain in sync.

Author: ofv <ofv at 91177308-0d34-0410-b5e6-96231b3b80d8>  2010-10-16 22:26:16

    Build with RTTI and exceptions disabled. Only in GCC for now.

------------------------ utils/unittest/CMakeLists.txt ------------------------
index 4400b38..9d678ed 100644
@@ -24,6 +24,12 @@ if(SUPPORTS_NO_VARIADIC_MACROS_FLAG)
   add_definitions("-Wno-variadic-macros")
 endif()

+set(LLVM_REQUIRES_RTTI 1)
+add_definitions( -DGTEST_HAS_RTTI=0 )
+# libstdc++'s TR1 <tuple> header depends on RTTI and uses C++'0x features not
+# supported by Clang, so force googletest to use its own tuple implementation.
+add_definitions( -DGTEST_USE_OWN_TR1_TUPLE )
+
 add_llvm_library(gtest
   googletest/gtest.cc
   googletest/gtest-death-test.cc

> [snip]
>
>>> Doing otherwise on
>>> the cmake build requires a commentary on the CMakeLists.txt file.
>>
>> I think my change is a simple fixup. I was sorry not to fill the last
>> commit log better.
>> And I think it would not be needed to put comments especially unless
>> it does different that Makefile does.
>
> After seeing your change, I was confused thinking that
> unittests/Makefile was setting REQUIRE_RTTI to 1 too. Actually, your
> change syncs the settings of CMakeLists.txt with the Makefile, which is
> good.
>
>> Anyway I am working on unittests/cmake.
>> Please be patient, thank you.
>
> Great. I don't know much about the testing framework, but if you need
> help with CMake, let me know.




More information about the llvm-commits mailing list