1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
5 config("gtest_config") {
8 "//testing/gmock:*", # gmock also shares this config.
12 # In order to allow regex matches in gtest to be shared between Windows
13 # and other systems, we tell gtest to always use it's internal engine.
14 "GTEST_HAS_POSIX_RE=0",
16 # Chrome doesn't support / require C++11, yet.
20 # Gtest headers need to be able to find themselves.
21 include_dirs = [ "include" ]
24 cflags = [ "/wd4800" ] # Unused variable warning.
29 # gtest isn't able to figure out when RTTI is disabled for gcc
30 # versions older than 4.3.2, and assumes it's enabled. Our Mac
31 # and Linux builds disable RTTI, and cannot guarantee that the
32 # compiler will be 4.3.2. or newer. The Mac, for example, uses
33 # 4.2.1 as that is the latest available on that platform. gtest
34 # must be instructed that RTTI is disabled here, and for any
35 # direct dependents that might include gtest headers.
42 # We want gtest features that use tr1::tuple, but we currently
43 # don't support the variadic templates used by libstdc++'s
44 # implementation. gtest supports this scenario by providing its
45 # own implementation but we must opt in to it.
46 "GTEST_USE_OWN_TR1_TUPLE=1",
48 # GTEST_USE_OWN_TR1_TUPLE only works if GTEST_HAS_TR1_TUPLE is set.
49 # gtest r625 made it so that GTEST_HAS_TR1_TUPLE is set to 0
50 # automatically on android, so it has to be set explicitly here.
51 "GTEST_HAS_TR1_TUPLE=1",
56 config("gtest_direct_config") {
58 defines = [ "UNIT_TEST" ]
61 static_library("gtest") {
62 # TODO http://crbug.com/412064 enable this flag all the time.
63 testonly = !is_component_build
65 "include/gtest/gtest-death-test.h",
66 "include/gtest/gtest-message.h",
67 "include/gtest/gtest-param-test.h",
68 "include/gtest/gtest-printers.h",
69 "include/gtest/gtest-spi.h",
70 "include/gtest/gtest-test-part.h",
71 "include/gtest/gtest-typed-test.h",
72 "include/gtest/gtest.h",
73 "include/gtest/gtest_pred_impl.h",
74 "include/gtest/internal/gtest-death-test-internal.h",
75 "include/gtest/internal/gtest-filepath.h",
76 "include/gtest/internal/gtest-internal.h",
77 "include/gtest/internal/gtest-linked_ptr.h",
78 "include/gtest/internal/gtest-param-util-generated.h",
79 "include/gtest/internal/gtest-param-util.h",
80 "include/gtest/internal/gtest-port.h",
81 "include/gtest/internal/gtest-string.h",
82 "include/gtest/internal/gtest-tuple.h",
83 "include/gtest/internal/gtest-type-util.h",
85 #"gtest/src/gtest-all.cc", # Not needed by our build.
86 "../multiprocess_func_list.cc",
87 "../multiprocess_func_list.h",
89 "src/gtest-death-test.cc",
90 "src/gtest-filepath.cc",
91 "src/gtest-internal-inl.h",
93 "src/gtest-printers.cc",
94 "src/gtest-test-part.cc",
95 "src/gtest-typed-test.cc",
103 "../platform_test_mac.mm",
107 include_dirs = [ "." ]
109 all_dependent_configs = [ ":gtest_config" ]
110 public_configs = [ ":gtest_direct_config" ]
112 configs -= [ "//build/config/compiler:chromium_code" ]
113 configs += [ "//build/config/compiler:no_chromium_code" ]
116 source_set("gtest_main") {
117 # TODO http://crbug.com/412064 enable this flag all the time.
118 testonly = !is_component_build