blob: bf736704f5498dc37ad3d31bd4d6f81dd7d48e14 [file] [log] [blame]
Misha Brukman922e3492009-01-01 01:29:44 +00001##===- utils/unittest/googletest/Makefile ------------------*- Makefile -*-===##
2#
3# The LLVM Compiler Infrastructure
4#
5# This file is distributed under the University of Illinois Open Source
6# License. See LICENSE.TXT for details.
7#
8##===----------------------------------------------------------------------===##
9
10LEVEL := ../../..
Daniel Dunbarb18efec2009-09-20 06:17:12 +000011
Misha Brukman922e3492009-01-01 01:29:44 +000012include $(LEVEL)/Makefile.config
Mike Stump67f5cea2009-02-05 20:45:27 +000013
Daniel Dunbar06bb7982011-12-15 23:35:08 +000014LIBRARYNAME = gtest
Misha Brukman922e3492009-01-01 01:29:44 +000015BUILD_ARCHIVE = 1
Chris Lattner823aed12010-01-24 20:43:08 +000016REQUIRES_RTTI = 1
Chandler Carruth28d5f762010-03-09 19:24:49 +000017
18# Note that these flags are duplicated when building individual tests in
Chandler Carruth25fcb612010-03-09 22:45:10 +000019# unittests/Makefile.unittest and ../UnitTestMain/Makefile; ensure that any
20# changes are made to both.
Benjamin Kramer729749d2009-07-27 09:39:18 +000021CPP.Flags += -I$(LLVM_SRC_ROOT)/utils/unittest/googletest/include
Mike Stump354d3de2009-02-05 20:49:49 +000022CPP.Flags += $(NO_MISSING_FIELD_INITIALIZERS) $(NO_VARIADIC_MACROS)
Chandler Carruth28d5f762010-03-09 19:24:49 +000023CPP.Flags += -DGTEST_HAS_RTTI=0
Benjamin Kramer1add5f32010-06-03 07:51:58 +000024# libstdc++'s TR1 <tuple> header depends on RTTI and uses C++'0x features not
25# supported by Clang, so force googletest to use its own tuple implementation.
26CPP.Flags += -DGTEST_USE_OWN_TR1_TUPLE
Misha Brukman922e3492009-01-01 01:29:44 +000027
Benjamin Kramer7cd082a2010-06-03 15:17:04 +000028# Disable pthreads if LLVM was configured without them.
29ifneq ($(HAVE_PTHREAD), 1)
30 CPP.Flags += -DGTEST_HAS_PTHREAD=0
31endif
32
Anton Korobeynikov90e17e72009-08-18 00:40:33 +000033ifeq ($(HOST_OS),MingW)
Julien Lerougecbc24912009-02-12 08:02:35 +000034 CPP.Flags += -DGTEST_OS_WINDOWS=1
35endif
36
Chris Lattner8bbd76b2009-05-08 17:32:47 +000037NO_INSTALL = 1
38
NAKAMURA Takumi10dd7662012-12-07 01:25:45 +000039SOURCES = $(filter-out gtest-all.cc, $(notdir $(wildcard $(PROJ_SRC_DIR)/*.cc)))
Alexey Samsonov9ddc3042012-12-06 23:59:54 +000040
Misha Brukman922e3492009-01-01 01:29:44 +000041include $(LEVEL)/Makefile.common