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..55dc2f5f83bc9f3a740db62e8e2c4f247cfe765d 100644 |
--- a/tools/gn/secondary/testing/gtest/BUILD.gn |
+++ b/tools/gn/secondary/testing/gtest/BUILD.gn |
@@ -3,8 +3,14 @@ |
# found in the LICENSE file. |
config("gtest_config") { |
- defines = [ "UNIT_TEST" ] |
+ defines = [ |
+ "UNIT_TEST", |
+ "GTEST_HAS_POSIX_RE=0", |
+ "GTEST_HAS_RTTI=0", |
+ ] |
+ |
include_dirs = [ "include" ] # Gtest headers need to be able to find themselves. |
brettw
2014/01/06 20:41:29
Can you fix this long line while you're here (prob
tfarina
2014/01/06 22:48:15
Done.
|
+ |
if (is_win) { |
cflags = [ "/wd4800" ] # Unused variable warning. |
} |
@@ -47,6 +53,26 @@ static_library("gtest") { |
"../platform_test.h", |
] |
+ defines = [ |
+ # 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", |
brettw
2014/01/06 20:41:29
You don't need this, same reason as below.
tfarina
2014/01/06 22:48:15
Done.
|
+ ] |
+ |
+ 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", |
brettw
2014/01/06 20:41:29
You don't need this since it's on the config, and
tfarina
2014/01/06 22:48:15
Done.
|
+ ] |
+ direct_dependent_configs = [ ":gtest_config" ] |
brettw
2014/01/06 20:41:29
You don't need this since you add it below.
tfarina
2014/01/06 22:48:15
Done.
|
+ } |
+ |
if (is_mac) { |
sources += [ |
"gtest_mac.h", |
@@ -56,7 +82,8 @@ static_library("gtest") { |
} |
include_dirs = [ "." ] |
- direct_dependent_configs = [ ":gtest_config" ] |
+ all_dependent_configs = [ ":gtest_config" ] |
+ direct_dependent_configs += [ ":gtest_config" ] |
brettw
2014/01/06 20:41:29
You don't need this since 'all' handles everything
tfarina
2014/01/06 22:48:15
Done.
|
configs -= "//build/config/compiler:chromium_code" |
configs += "//build/config/compiler:no_chromium_code" |