Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import("//build_overrides/gtest.gni") | 5 import("//build_overrides/gtest.gni") |
| 6 | 6 |
| 7 config("gtest_config") { | 7 config("gtest_config") { |
| 8 visibility = [ | 8 visibility = [ |
| 9 ":*", | 9 ":*", |
| 10 "//testing/gmock:*", # gmock also shares this config. | 10 "//testing/gmock:*", # gmock also shares this config. |
| 11 ] | 11 ] |
| 12 | 12 |
| 13 defines = [ | 13 defines = [ |
| 14 # In order to allow regex matches in gtest to be shared between Windows | 14 # In order to allow regex matches in gtest to be shared between Windows |
| 15 # and other systems, we tell gtest to always use it's internal engine. | 15 # and other systems, we tell gtest to always use it's internal engine. |
| 16 "GTEST_HAS_POSIX_RE=0", | 16 "GTEST_HAS_POSIX_RE=0", |
| 17 | 17 |
| 18 # Chrome doesn't support / require C++11, yet. | 18 # Chrome doesn't support / require C++11, yet. |
| 19 "GTEST_LANG_CXX11=0", | 19 "GTEST_LANG_CXX11=0", |
| 20 ] | 20 ] |
| 21 | 21 |
| 22 # Gtest headers need to be able to find themselves. | 22 # Gtest headers need to be able to find themselves. |
| 23 include_dirs = [ "include" ] | 23 include_dirs = [ "include" ] |
| 24 | 24 |
| 25 if (is_win) { | 25 if (is_win) { |
| 26 cflags = [ "/wd4800" ] # Unused variable warning. | 26 cflags = [ "/wd4800" ] # Unused variable warning. |
| 27 } | 27 } |
| 28 | |
| 29 if (is_posix) { | |
| 30 defines += [ | |
| 31 # gtest isn't able to figure out when RTTI is disabled for gcc | |
| 32 # versions older than 4.3.2, and assumes it's enabled. Our Mac | |
|
danakj
2016/07/21 18:54:58
I currently have gcc 4.8.4, so that's a long way f
tzik
2016/07/21 19:06:24
Yes. According to the comment around the feature d
| |
| 33 # and Linux builds disable RTTI, and cannot guarantee that the | |
| 34 # compiler will be 4.3.2. or newer. The Mac, for example, uses | |
| 35 # 4.2.1 as that is the latest available on that platform. gtest | |
| 36 # must be instructed that RTTI is disabled here, and for any | |
| 37 # direct dependents that might include gtest headers. | |
| 38 "GTEST_HAS_RTTI=0", | |
| 39 ] | |
| 40 } | |
| 41 | |
| 42 if (is_android) { | |
| 43 defines += [ | |
| 44 # We want gtest features that use tr1::tuple, but we currently | |
| 45 # don't support the variadic templates used by libstdc++'s | |
| 46 # implementation. gtest supports this scenario by providing its | |
| 47 # own implementation but we must opt in to it. | |
| 48 "GTEST_USE_OWN_TR1_TUPLE=1", | |
|
danakj
2016/07/21 18:54:58
This looks ok to remove, we support variadic templ
| |
| 49 | |
| 50 # GTEST_USE_OWN_TR1_TUPLE only works if GTEST_HAS_TR1_TUPLE is set. | |
| 51 # gtest r625 made it so that GTEST_HAS_TR1_TUPLE is set to 0 | |
| 52 # automatically on android, so it has to be set explicitly here. | |
| 53 "GTEST_HAS_TR1_TUPLE=1", | |
| 54 ] | |
| 55 } | |
| 56 } | 28 } |
| 57 | 29 |
| 58 config("gtest_direct_config") { | 30 config("gtest_direct_config") { |
| 59 visibility = [ ":*" ] | 31 visibility = [ ":*" ] |
| 60 defines = [ "UNIT_TEST" ] | 32 defines = [ "UNIT_TEST" ] |
| 61 } | 33 } |
| 62 | 34 |
| 63 config("gtest_warnings") { | 35 config("gtest_warnings") { |
| 64 if (is_win && is_clang) { | 36 if (is_win && is_clang) { |
| 65 # The Mutex constructor initializer list in gtest-port.cc is incorrectly | 37 # The Mutex constructor initializer list in gtest-port.cc is incorrectly |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 151 | 123 |
| 152 source_set("gtest_main") { | 124 source_set("gtest_main") { |
| 153 testonly = true | 125 testonly = true |
| 154 sources = [ | 126 sources = [ |
| 155 "src/gtest_main.cc", | 127 "src/gtest_main.cc", |
| 156 ] | 128 ] |
| 157 deps = [ | 129 deps = [ |
| 158 ":gtest", | 130 ":gtest", |
| 159 ] | 131 ] |
| 160 } | 132 } |
| OLD | NEW |