Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Unified Diff: tools/gn/secondary/testing/gtest/BUILD.gn

Issue 124773002: Port some gtest.gyp settings to the BUILD.gn file (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Brett review Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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"
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698