Index: BUILD.gn |
diff --git a/BUILD.gn b/BUILD.gn |
index 01b023ee62da8219f12c574ea4548012bed04f7c..04bf80ffff6c64ecf1d7c4a718cfe395d36db08b 100644 |
--- a/BUILD.gn |
+++ b/BUILD.gn |
@@ -122,6 +122,10 @@ static_library("libyuv") { |
# Enable optimize for speed (-O2) over size (-Os). |
configs += [ "//build/config/compiler:optimize_max" ] |
} |
+ |
+ # To enable AVX2 or other cpu optimization, pass flag here |
+ # cflags = [ "-mavx2" ] |
+ |
} |
if (libyuv_use_neon) { |
@@ -140,6 +144,14 @@ if (libyuv_use_neon) { |
public_configs = [ ":libyuv_config" ] |
+ # Always enable optimization for Release and NaCl builds (to workaround |
+ # crbug.com/538243). |
+ if (!is_debug) { |
+ configs -= [ "//build/config/compiler:default_optimization" ] |
+ # Enable optimize for speed (-O2) over size (-Os). |
+ configs += [ "//build/config/compiler:optimize_max" ] |
+ } |
+ |
if (current_cpu != "arm64") { |
configs -= [ "//build/config/compiler:compiler_arm_fpu" ] |
cflags = [ "-mfpu=neon" ] |