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

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

Issue 1881193002: Add GN arg to optimize for size (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Move comment Created 4 years, 8 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 9583f779dfff6f1ae3a7c14f00a5c384789b2852..3cf72220237662772be19973c54a9c9de54012fd 100644
--- a/build/config/compiler/BUILD.gn
+++ b/build/config/compiler/BUILD.gn
@@ -80,6 +80,12 @@ declare_args() {
# If true, gold linker will save symbol table inside object files.
# This speeds up gdb startup by 60%
gdb_index = false
+
+ # If true, optimize for size. Does not affect windows builds.
+ # Linux & Mac favor speed over size.
+ # TODO(brettw) it's weird that Mac and desktop Linux are different. We should
+ # explore favoring size over speed in this case as well.
+ optimize_for_size = is_android || is_ios
}
# Apply the default logic for these values if they were not set explicitly.
@@ -1209,13 +1215,10 @@ config("optimize") {
# Favor size over speed, /O1 must be before the common flags. The GYP
# build also specifies /Os and /GF but these are implied by /O1.
cflags = [ "/O1" ] + common_optimize_on_cflags + [ "/Oi" ]
- } else if (is_android || is_ios) {
+ } else if (optimize_for_size) {
# Favor size over speed.
cflags = [ "-Os" ] + common_optimize_on_cflags
} else {
- # Linux & Mac favor speed over size.
- # TODO(brettw) it's weird that Mac and desktop Linux are different. We should
- # explore favoring size over speed in this case as well.
cflags = [ "-O2" ] + common_optimize_on_cflags
}
ldflags = common_optimize_on_ldflags
« 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