Index: build/config/compiler/BUILD.gn |
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn |
index 2d9564f3e1d1d47aa74c2a8fd8fa57da05c356e2..0e0179f5b107d2b4aabdec57fbc7c31cb1f4ec8a 100644 |
--- a/build/config/compiler/BUILD.gn |
+++ b/build/config/compiler/BUILD.gn |
@@ -703,12 +703,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. |
@@ -719,6 +713,14 @@ config("optimize") { |
cflags += [ |
"/Os", # favor size over speed. |
] |
+ } else if (is_android || is_ios) { |
+ cflags += [ |
+ "-Os", # Favor size over speed. |
+ ] |
+ } else { |
+ cflags += [ |
+ "-O2", |
+ ] |
} |
} |
@@ -756,6 +758,10 @@ config("optimize_max") { |
"/Ot", # Favor speed over size. |
"/GL", # Whole program optimization. |
] |
+ } else { |
+ cflags += [ |
+ "-O2", |
+ ] |
} |
} |