| Index: BUILD.gn
|
| diff --git a/BUILD.gn b/BUILD.gn
|
| index 2243e81df9d0330b239c8ef71f23f99853cbafbf..3e8496e0f22a666e798b8c3c2eed569b39a0b74f 100644
|
| --- a/BUILD.gn
|
| +++ b/BUILD.gn
|
| @@ -42,8 +42,21 @@ config("libvpx_config") {
|
| "//third_party/libvpx/source/libvpx",
|
| "$root_gen_dir/third_party/libvpx", # Provides vpx_rtcd.h.
|
| ]
|
| - if (!is_win) {
|
| - cflags = [ "-Wno-unused-function", "-Wno-sign-compare" ]
|
| +}
|
| +
|
| +# gn orders flags on a target before flags from configs. The default config
|
| +# adds -Wall, and these flags have to be after -Wall -- so they need to come
|
| +# from a config and can't be on the target directly.
|
| +config("libvpx_warnings") {
|
| + if (is_clang) {
|
| + cflags = [
|
| + # libvpx heavily relies on implicit enum casting.
|
| + "-Wno-conversion",
|
| + # libvpx does `if ((a == b))` in some places.
|
| + "-Wno-parentheses-equality",
|
| + # libvpx has many static functions in header, which trigger this warning.
|
| + "-Wno-unused-function",
|
| + ]
|
| }
|
| }
|
|
|
| @@ -76,6 +89,7 @@ static_library("libvpx_intrinsics_mmx") {
|
| configs += [ ":libvpx_config" ]
|
| configs -= [ "//build/config/compiler:chromium_code" ]
|
| configs += [ "//build/config/compiler:no_chromium_code" ]
|
| + configs += [ ":libvpx_warnings" ]
|
| if (!is_win) {
|
| cflags = [ "-mmmx" ]
|
| }
|
| @@ -90,6 +104,7 @@ static_library("libvpx_intrinsics_sse2") {
|
| configs += [ ":libvpx_config" ]
|
| configs -= [ "//build/config/compiler:chromium_code" ]
|
| configs += [ "//build/config/compiler:no_chromium_code" ]
|
| + configs += [ ":libvpx_warnings" ]
|
| if (!is_win || is_clang) {
|
| cflags = [ "-msse2" ]
|
| }
|
| @@ -104,6 +119,7 @@ static_library("libvpx_intrinsics_ssse3") {
|
| configs += [ ":libvpx_config" ]
|
| configs -= [ "//build/config/compiler:chromium_code" ]
|
| configs += [ "//build/config/compiler:no_chromium_code" ]
|
| + configs += [ ":libvpx_warnings" ]
|
| if (!is_win || is_clang) {
|
| cflags = [ "-mssse3" ]
|
| }
|
| @@ -118,6 +134,7 @@ static_library("libvpx_intrinsics_sse4_1") {
|
| configs += [ ":libvpx_config" ]
|
| configs -= [ "//build/config/compiler:chromium_code" ]
|
| configs += [ "//build/config/compiler:no_chromium_code" ]
|
| + configs += [ ":libvpx_warnings" ]
|
| if (!is_win || is_clang) {
|
| cflags = [ "-msse4.1" ]
|
| }
|
| @@ -132,6 +149,7 @@ static_library("libvpx_intrinsics_avx2") {
|
| configs += [ ":libvpx_config" ]
|
| configs -= [ "//build/config/compiler:chromium_code" ]
|
| configs += [ "//build/config/compiler:no_chromium_code" ]
|
| + configs += [ ":libvpx_warnings" ]
|
| if (is_win) {
|
| cflags = [ "/arch:AVX2" ]
|
| } else {
|
| @@ -148,6 +166,7 @@ if (cpu_arch_full == "arm-neon-cpu-detect") {
|
| static_library("libvpx_intrinsics_neon") {
|
| configs -= [ "//build/config/compiler:compiler_arm_fpu" ]
|
| configs += [ ":libvpx_config" ]
|
| + configs += [ ":libvpx_warnings" ]
|
| cflags = [ "-mfpu=neon" ]
|
| sources = libvpx_srcs_arm_neon_cpu_detect_neon
|
| }
|
| @@ -178,6 +197,7 @@ if (current_cpu == "arm") {
|
| sources = get_target_outputs(":convert_arm_assembly")
|
| configs -= [ "//build/config/compiler:compiler_arm_fpu" ]
|
| configs += [ ":libvpx_config" ]
|
| + configs += [ ":libvpx_warnings" ]
|
| if (cpu_arch_full == "arm-neon" ||
|
| cpu_arch_full == "arm-neon-cpu-detect") {
|
| cflags = [ "-mfpu=neon" ]
|
| @@ -188,15 +208,6 @@ if (current_cpu == "arm") {
|
| }
|
| }
|
|
|
| -# gn orders flags on a target before flags from configs. The default config
|
| -# adds -Wall, and these flags have to be after -Wall -- so they need to come
|
| -# from a config and can't be on the target directly.
|
| -config("libvpx_warnings") {
|
| - if (is_clang) {
|
| - cflags = [ "-Wno-conversion" ]
|
| - }
|
| -}
|
| -
|
| static_library("libvpx") {
|
| if (!is_debug && is_win && is_official_build) {
|
| configs -= [ "//build/config/compiler:optimize" ]
|
|
|