| Index: tools/gn/secondary/testing/gtest/BUILD.gn
|
| diff --git a/tools/gn/secondary/testing/gtest/BUILD.gn b/tools/gn/secondary/testing/gtest/BUILD.gn
|
| index 4e08fcead032a41e82b26559f2f745edbccc9863..7b7272f3fdb10991352464477045d3a66a94dd63 100644
|
| --- a/tools/gn/secondary/testing/gtest/BUILD.gn
|
| +++ b/tools/gn/secondary/testing/gtest/BUILD.gn
|
| @@ -3,11 +3,33 @@
|
| # found in the LICENSE file.
|
|
|
| config("gtest_config") {
|
| - defines = [ "UNIT_TEST" ]
|
| - include_dirs = [ "include" ] # Gtest headers need to be able to find themselves.
|
| + defines = [
|
| + "UNIT_TEST",
|
| +
|
| + # In order to allow regex matches in gtest to be shared between Windows
|
| + # and other systems, we tell gtest to always use it's internal engine.
|
| + "GTEST_HAS_POSIX_RE=0",
|
| + ]
|
| +
|
| + # Gtest headers need to be able to find themselves.
|
| + include_dirs = [ "include" ]
|
| +
|
| if (is_win) {
|
| cflags = [ "/wd4800" ] # Unused variable warning.
|
| }
|
| +
|
| + if (is_posix) {
|
| + defines += [
|
| + # gtest isn't able to figure out when RTTI is disabled for gcc
|
| + # versions older than 4.3.2, and assumes it's enabled. Our Mac
|
| + # and Linux builds disable RTTI, and cannot guarantee that the
|
| + # compiler will be 4.3.2. or newer. The Mac, for example, uses
|
| + # 4.2.1 as that is the latest available on that platform. gtest
|
| + # must be instructed that RTTI is disabled here, and for any
|
| + # direct dependents that might include gtest headers.
|
| + "GTEST_HAS_RTTI=0",
|
| + ]
|
| + }
|
| }
|
|
|
| static_library("gtest") {
|
| @@ -56,7 +78,8 @@ static_library("gtest") {
|
| }
|
|
|
| include_dirs = [ "." ]
|
| - direct_dependent_configs = [ ":gtest_config" ]
|
| +
|
| + all_dependent_configs = [ ":gtest_config" ]
|
|
|
| configs -= "//build/config/compiler:chromium_code"
|
| configs += "//build/config/compiler:no_chromium_code"
|
|
|