Optionally use new GN optimization config.
authorbrettw <brettw@chromium.org>
Fri, 11 Sep 2015 18:28:15 +0000 (11:28 -0700)
committerCommit bot <commit-bot@chromium.org>
Fri, 11 Sep 2015 18:28:24 +0000 (18:28 +0000)
The GN default optimization flag is changing from being specific to the
debug/release status of the build to always being "default_optimization" so
it's easier to override without being conditional on the exact setup in
BUILDCONFIG.gn. See https://codereview.chromium.org/1324623005/

Since V8 is DEPS-ed in, it will need to support both modes to allow a landing.
This patch uses a temporary transitional flag I added to BUILDCONFIG to
indicate which variant should be used. After the patch is landed, we can remove
the new conditions and just remove default_optimization.

Review URL: https://codereview.chromium.org/1333963002

Cr-Commit-Position: refs/heads/master@{#30703}

BUILD.gn

index d6341f7..23108b9 100644 (file)
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -1534,7 +1534,11 @@ source_set("v8_base") {
   ]
 
   if (!is_debug) {
-    configs -= [ "//build/config/compiler:optimize" ]
+    if (using_new_optimization_config) {
+      configs -= [ "//build/config/compiler:default_optimization" ]
+    } else {
+      configs -= [ "//build/config/compiler:optimize" ]
+    }
     configs += [ "//build/config/compiler:optimize_max" ]
   }
 
@@ -1633,7 +1637,11 @@ source_set("v8_libbase") {
   ]
 
   if (!is_debug) {
-    configs -= [ "//build/config/compiler:optimize" ]
+    if (using_new_optimization_config) {
+      configs -= [ "//build/config/compiler:default_optimization" ]
+    } else {
+      configs -= [ "//build/config/compiler:optimize" ]
+    }
     configs += [ "//build/config/compiler:optimize_max" ]
   }
 
@@ -1700,7 +1708,11 @@ source_set("v8_libplatform") {
   ]
 
   if (!is_debug) {
-    configs -= [ "//build/config/compiler:optimize" ]
+    if (using_new_optimization_config) {
+      configs -= [ "//build/config/compiler:default_optimization" ]
+    } else {
+      configs -= [ "//build/config/compiler:optimize" ]
+    }
     configs += [ "//build/config/compiler:optimize_max" ]
   }