Index: build/config/compiler/BUILD.gn |
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn |
index 49a859ac5e1c54864790f9b82e191e45368dbce8..a0b1e860ec70381e2c8a6c83cf07a44199107acd 100644 |
--- a/build/config/compiler/BUILD.gn |
+++ b/build/config/compiler/BUILD.gn |
@@ -693,12 +693,6 @@ if (is_win) { |
"-Wl,--gc-sections", |
] |
} |
- |
- if (is_android || is_ios) { |
- common_optimize_on_cflags += [ "-Os" ] |
- } else { |
- common_optimize_on_cflags += [ "-O2" ] |
- } |
} |
# Default "optimization on" config. On Windows, this favors size over speed. |
@@ -709,6 +703,14 @@ config("optimize") { |
cflags += [ |
"/Os", # favor size over speed. |
] |
+ } else if (is_android || is_ios) { |
+ cflags += [ |
+ "-Os", # Favor size over speed. |
+ ] |
+ } else { |
+ cflags += [ |
+ "-O2", |
+ ] |
} |
} |
@@ -746,6 +748,10 @@ config("optimize_max") { |
"/Ot", # Favor speed over size. |
"/GL", # Whole program optimization. |
] |
+ } else { |
+ cflags += [ |
+ "-O2", |
+ ] |
} |
} |