From 8ef297e9451b678868fe08a249a5d1d101ee84bc Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Thu, 3 Jun 2010 07:51:58 +0000 Subject: [PATCH] Turns out gtest still prefers the system over it's own implementation. Force the internal one to unbreak clang selfhost on linux. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105386 91177308-0d34-0410-b5e6-96231b3b80d8 --- unittests/Makefile.unittest | 3 +++ utils/unittest/UnitTestMain/Makefile | 3 +++ utils/unittest/googletest/Makefile | 3 +++ 3 files changed, 9 insertions(+) diff --git a/unittests/Makefile.unittest b/unittests/Makefile.unittest index 3bed567503d..6001c436e5a 100644 --- a/unittests/Makefile.unittest +++ b/unittests/Makefile.unittest @@ -23,6 +23,9 @@ LLVMUnitTestExe = $(BuildMode)/$(TESTNAME)Tests$(EXEEXT) CPP.Flags += -I$(LLVM_SRC_ROOT)/utils/unittest/googletest/include CPP.Flags += $(NO_MISSING_FIELD_INITIALIZERS) $(NO_VARIADIC_MACROS) CPP.Flags += -DGTEST_HAS_RTTI=0 +# libstdc++'s TR1 header depends on RTTI and uses C++'0x features not +# supported by Clang, so force googletest to use its own tuple implementation. +CPP.Flags += -DGTEST_USE_OWN_TR1_TUPLE TESTLIBS = -lGoogleTest -lUnitTestMain diff --git a/utils/unittest/UnitTestMain/Makefile b/utils/unittest/UnitTestMain/Makefile index 16ac38b5688..202ccb8eeed 100644 --- a/utils/unittest/UnitTestMain/Makefile +++ b/utils/unittest/UnitTestMain/Makefile @@ -18,5 +18,8 @@ REQUIRES_RTTI = 1 CPP.Flags += -I$(LLVM_SRC_ROOT)/utils/unittest/googletest/include CPP.Flags += $(NO_MISSING_FIELD_INITIALIZERS) $(NO_VARIADIC_MACROS) CPP.Flags += -DGTEST_HAS_RTTI=0 +# libstdc++'s TR1 header depends on RTTI and uses C++'0x features not +# supported by Clang, so force googletest to use its own tuple implementation. +CPP.Flags += -DGTEST_USE_OWN_TR1_TUPLE include $(LEVEL)/Makefile.common diff --git a/utils/unittest/googletest/Makefile b/utils/unittest/googletest/Makefile index b6e3e68a330..bfd35a4f510 100644 --- a/utils/unittest/googletest/Makefile +++ b/utils/unittest/googletest/Makefile @@ -21,6 +21,9 @@ REQUIRES_RTTI = 1 CPP.Flags += -I$(LLVM_SRC_ROOT)/utils/unittest/googletest/include CPP.Flags += $(NO_MISSING_FIELD_INITIALIZERS) $(NO_VARIADIC_MACROS) CPP.Flags += -DGTEST_HAS_RTTI=0 +# libstdc++'s TR1 header depends on RTTI and uses C++'0x features not +# supported by Clang, so force googletest to use its own tuple implementation. +CPP.Flags += -DGTEST_USE_OWN_TR1_TUPLE ifeq ($(HOST_OS),MingW) CPP.Flags += -DGTEST_OS_WINDOWS=1