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

Unified Diff: build/config/compiler/BUILD.gn

Issue 2022733002: gn: Add an 'optimize' config for components (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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: build/config/compiler/BUILD.gn
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
index 5e1e024ea5ff15eebdb3307d77058d67673073c9..4c32281faba650b5b8856c5ff9632376b2421c5d 100644
--- a/build/config/compiler/BUILD.gn
+++ b/build/config/compiler/BUILD.gn
@@ -1308,10 +1308,8 @@ config("no_optimize") {
}
}
-# Turns up the optimization level. On Windows, this implies whole program
-# optimization and link-time code generation which is very expensive and should
-# be used sparingly.
-config("optimize_max") {
+# Internal common config used by optimize_max and optimize_component.
+config("common_optimize_max") {
Michael Achenbach 2016/05/30 11:38:07 Is there a better way to share a common config wit
Dirk Pranke 2016/05/31 19:46:18 Not really, but it's not something we tend to worr
if (is_nacl_irt) {
# The NaCl IRT is a special case and always wants its own config.
# Various components do:
@@ -1341,12 +1339,32 @@ config("optimize_max") {
"/wd4702",
]
}
- } else {
+ }
+ }
+}
+
+# Turns up the optimization level. On Windows, this implies whole program
+# optimization and link-time code generation which is very expensive and should
+# be used sparingly.
+config("optimize_max") {
+ configs = [ ":common_optimize_max" ]
Michael Achenbach 2016/05/30 11:38:07 Does the line: configs -= ["optimize_max"] also re
Dirk Pranke 2016/05/31 19:46:18 Yes, I think so.
+ if (!is_nacl_irt) {
+ if (!is_win) {
cflags = [ "-O2" ] + common_optimize_on_cflags
}
}
}
+# Some components like v8 use higher optimization levels on linux and mac.
+config("optimize_component") {
Michael Achenbach 2016/05/30 11:38:07 Named this optimize_component as I don't like opti
+ configs = [ ":common_optimize_max" ]
+ if (!is_nacl_irt) {
+ if (!is_win) {
+ cflags = [ "-O3" ] + common_optimize_on_cflags
+ }
+ }
+}
+
# The default optimization applied to all targets. This will be equivalent to
# either "optimize" or "no_optimize", depending on the build flags.
config("default_optimization") {
« 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