Index: BUILD.gn |
diff --git a/BUILD.gn b/BUILD.gn |
index 2243e81df9d0330b239c8ef71f23f99853cbafbf..df8c0682fac28753c7b9a77f484d21b31f053fac 100644 |
--- a/BUILD.gn |
+++ b/BUILD.gn |
@@ -54,6 +54,8 @@ config("libvpx_external_config") { |
] |
} |
+# GN requires distinct targets because it relies on the basename to avoid |
+# naming conflicts. |
if (current_cpu == "x86" || current_cpu == "x64") { |
yasm_assemble("libvpx_yasm") { |
if (current_cpu == "x86") { |
@@ -70,9 +72,54 @@ if (current_cpu == "x86" || current_cpu == "x64") { |
target_gen_dir |
] |
} |
Tom Finegan
2015/08/05 22:57:32
The existing stuff seems to always add a blank lin
Johann
2015/08/05 23:02:29
I left these together specifically because they're
|
+ yasm_assemble("vp8_libvpx_yasm") { |
+ if (current_cpu == "x86") { |
+ sources = vp8_libvpx_srcs_x86_assembly |
+ } else if (current_cpu == "x64") { |
+ sources = vp8_libvpx_srcs_x86_64_assembly |
+ } |
+ |
+ defines = [ "CHROMIUM" ] |
Tom Finegan
2015/08/05 22:57:32
This being repeated in all targets seems weird, bu
Johann
2015/08/05 23:02:29
I have no idea which defines etc are required, so
|
+ include_dirs = [ |
+ "//third_party/libvpx/source/config/$os_category/$cpu_arch_full", |
+ "//third_party/libvpx/source/config", |
+ "//third_party/libvpx/source/libvpx", |
+ target_gen_dir |
+ ] |
+ } |
+ yasm_assemble("vp9_libvpx_yasm") { |
+ if (current_cpu == "x86") { |
+ sources = vp9_libvpx_srcs_x86_assembly |
+ } else if (current_cpu == "x64") { |
+ sources = vp9_libvpx_srcs_x86_64_assembly |
+ } |
+ |
+ defines = [ "CHROMIUM" ] |
+ include_dirs = [ |
+ "//third_party/libvpx/source/config/$os_category/$cpu_arch_full", |
+ "//third_party/libvpx/source/config", |
+ "//third_party/libvpx/source/libvpx", |
+ target_gen_dir |
+ ] |
+ } |
+ yasm_assemble("vpx_dsp_libvpx_yasm") { |
+ if (current_cpu == "x86") { |
+ sources = vpx_dsp_libvpx_srcs_x86_assembly |
+ } else if (current_cpu == "x64") { |
+ sources = vpx_dsp_libvpx_srcs_x86_64_assembly |
+ } |
+ |
+ defines = [ "CHROMIUM" ] |
+ include_dirs = [ |
+ "//third_party/libvpx/source/config/$os_category/$cpu_arch_full", |
+ "//third_party/libvpx/source/config", |
+ "//third_party/libvpx/source/libvpx", |
+ target_gen_dir |
+ ] |
+ } |
} |
-static_library("libvpx_intrinsics_mmx") { |
+static_library("vp8_libvpx_intrinsics_mmx") { |
configs += [ ":libvpx_config" ] |
configs -= [ "//build/config/compiler:chromium_code" ] |
configs += [ "//build/config/compiler:no_chromium_code" ] |
@@ -80,13 +127,52 @@ static_library("libvpx_intrinsics_mmx") { |
cflags = [ "-mmmx" ] |
} |
if (current_cpu == "x86") { |
- sources = libvpx_srcs_x86_mmx |
+ sources = vp8_libvpx_srcs_x86_mmx |
} else if (current_cpu == "x64") { |
- sources = libvpx_srcs_x86_64_mmx |
+ sources = vp8_libvpx_srcs_x86_64_mmx |
+ } |
+} |
+static_library("vp9_libvpx_intrinsics_mmx") { |
+ configs += [ ":libvpx_config" ] |
+ configs -= [ "//build/config/compiler:chromium_code" ] |
+ configs += [ "//build/config/compiler:no_chromium_code" ] |
+ if (!is_win) { |
+ cflags = [ "-mmmx" ] |
+ } |
+ if (current_cpu == "x86") { |
+ sources = vp9_libvpx_srcs_x86_mmx |
+ } else if (current_cpu == "x64") { |
+ sources = vp9_libvpx_srcs_x86_64_mmx |
+ } |
+} |
+static_library("vpx_dsp_libvpx_intrinsics_mmx") { |
+ configs += [ ":libvpx_config" ] |
+ configs -= [ "//build/config/compiler:chromium_code" ] |
+ configs += [ "//build/config/compiler:no_chromium_code" ] |
+ if (!is_win) { |
+ cflags = [ "-mmmx" ] |
+ } |
+ if (current_cpu == "x86") { |
+ sources = vpx_dsp_libvpx_srcs_x86_mmx |
+ } else if (current_cpu == "x64") { |
+ sources = vpx_dsp_libvpx_srcs_x86_64_mmx |
} |
} |
-static_library("libvpx_intrinsics_sse2") { |
+static_library("vp8_libvpx_intrinsics_sse2") { |
+ configs += [ ":libvpx_config" ] |
+ configs -= [ "//build/config/compiler:chromium_code" ] |
+ configs += [ "//build/config/compiler:no_chromium_code" ] |
+ if (!is_win || is_clang) { |
+ cflags = [ "-msse2" ] |
+ } |
+ if (current_cpu == "x86") { |
+ sources = vp8_libvpx_srcs_x86_sse2 |
+ } else if (current_cpu == "x64") { |
+ sources = vp8_libvpx_srcs_x86_64_sse2 |
+ } |
+} |
+static_library("vp9_libvpx_intrinsics_sse2") { |
configs += [ ":libvpx_config" ] |
configs -= [ "//build/config/compiler:chromium_code" ] |
configs += [ "//build/config/compiler:no_chromium_code" ] |
@@ -94,13 +180,52 @@ static_library("libvpx_intrinsics_sse2") { |
cflags = [ "-msse2" ] |
} |
if (current_cpu == "x86") { |
- sources = libvpx_srcs_x86_sse2 |
+ sources = vp9_libvpx_srcs_x86_sse2 |
} else if (current_cpu == "x64") { |
- sources = libvpx_srcs_x86_64_sse2 |
+ sources = vp9_libvpx_srcs_x86_64_sse2 |
+ } |
+} |
+static_library("vpx_dsp_libvpx_intrinsics_sse2") { |
+ configs += [ ":libvpx_config" ] |
+ configs -= [ "//build/config/compiler:chromium_code" ] |
+ configs += [ "//build/config/compiler:no_chromium_code" ] |
+ if (!is_win || is_clang) { |
+ cflags = [ "-msse2" ] |
+ } |
+ if (current_cpu == "x86") { |
+ sources = vpx_dsp_libvpx_srcs_x86_sse2 |
+ } else if (current_cpu == "x64") { |
+ sources = vpx_dsp_libvpx_srcs_x86_64_sse2 |
} |
} |
-static_library("libvpx_intrinsics_ssse3") { |
+static_library("vp8_libvpx_intrinsics_ssse3") { |
+ configs += [ ":libvpx_config" ] |
+ configs -= [ "//build/config/compiler:chromium_code" ] |
+ configs += [ "//build/config/compiler:no_chromium_code" ] |
+ if (!is_win || is_clang) { |
+ cflags = [ "-mssse3" ] |
+ } |
+ if (current_cpu == "x86") { |
+ sources = vp8_libvpx_srcs_x86_ssse3 |
+ } else if (current_cpu == "x64") { |
+ sources = vp8_libvpx_srcs_x86_64_ssse3 |
+ } |
+} |
+static_library("vp9_libvpx_intrinsics_ssse3") { |
+ configs += [ ":libvpx_config" ] |
+ configs -= [ "//build/config/compiler:chromium_code" ] |
+ configs += [ "//build/config/compiler:no_chromium_code" ] |
+ if (!is_win || is_clang) { |
+ cflags = [ "-mssse3" ] |
+ } |
+ if (current_cpu == "x86") { |
+ sources = vp9_libvpx_srcs_x86_ssse3 |
+ } else if (current_cpu == "x64") { |
+ sources = vp9_libvpx_srcs_x86_64_ssse3 |
+ } |
+} |
+static_library("vpx_dsp_libvpx_intrinsics_ssse3") { |
configs += [ ":libvpx_config" ] |
configs -= [ "//build/config/compiler:chromium_code" ] |
configs += [ "//build/config/compiler:no_chromium_code" ] |
@@ -108,13 +233,39 @@ static_library("libvpx_intrinsics_ssse3") { |
cflags = [ "-mssse3" ] |
} |
if (current_cpu == "x86") { |
- sources = libvpx_srcs_x86_ssse3 |
+ sources = vpx_dsp_libvpx_srcs_x86_ssse3 |
} else if (current_cpu == "x64") { |
- sources = libvpx_srcs_x86_64_ssse3 |
+ sources = vpx_dsp_libvpx_srcs_x86_64_ssse3 |
} |
} |
-static_library("libvpx_intrinsics_sse4_1") { |
+static_library("vp8_libvpx_intrinsics_sse4_1") { |
+ configs += [ ":libvpx_config" ] |
+ configs -= [ "//build/config/compiler:chromium_code" ] |
+ configs += [ "//build/config/compiler:no_chromium_code" ] |
+ if (!is_win || is_clang) { |
+ cflags = [ "-msse4.1" ] |
+ } |
+ if (current_cpu == "x86") { |
+ sources = vp8_libvpx_srcs_x86_sse4_1 |
+ } else if (current_cpu == "x64") { |
+ sources = vp8_libvpx_srcs_x86_64_sse4_1 |
+ } |
+} |
+static_library("vp9_libvpx_intrinsics_sse4_1") { |
+ configs += [ ":libvpx_config" ] |
+ configs -= [ "//build/config/compiler:chromium_code" ] |
+ configs += [ "//build/config/compiler:no_chromium_code" ] |
+ if (!is_win || is_clang) { |
+ cflags = [ "-msse4.1" ] |
+ } |
+ if (current_cpu == "x86") { |
+ sources = vp9_libvpx_srcs_x86_sse4_1 |
+ } else if (current_cpu == "x64") { |
+ sources = vp9_libvpx_srcs_x86_64_sse4_1 |
+ } |
+} |
+static_library("vpx_dsp_libvpx_intrinsics_sse4_1") { |
configs += [ ":libvpx_config" ] |
configs -= [ "//build/config/compiler:chromium_code" ] |
configs += [ "//build/config/compiler:no_chromium_code" ] |
@@ -122,13 +273,13 @@ static_library("libvpx_intrinsics_sse4_1") { |
cflags = [ "-msse4.1" ] |
} |
if (current_cpu == "x86") { |
- sources = libvpx_srcs_x86_sse4_1 |
+ sources = vpx_dsp_libvpx_srcs_x86_sse4_1 |
} else if (current_cpu == "x64") { |
- sources = libvpx_srcs_x86_64_sse4_1 |
+ sources = vpx_dsp_libvpx_srcs_x86_64_sse4_1 |
} |
} |
-static_library("libvpx_intrinsics_avx2") { |
+static_library("vp8_libvpx_intrinsics_avx2") { |
configs += [ ":libvpx_config" ] |
configs -= [ "//build/config/compiler:chromium_code" ] |
configs += [ "//build/config/compiler:no_chromium_code" ] |
@@ -138,31 +289,85 @@ static_library("libvpx_intrinsics_avx2") { |
cflags = [ "-mavx2" ] |
} |
if (current_cpu == "x86") { |
- sources = libvpx_srcs_x86_avx2 |
+ sources = vp8_libvpx_srcs_x86_avx2 |
} else if (current_cpu == "x64") { |
- sources = libvpx_srcs_x86_64_avx2 |
+ sources = vp8_libvpx_srcs_x86_64_avx2 |
+ } |
+} |
+static_library("vp9_libvpx_intrinsics_avx2") { |
+ configs += [ ":libvpx_config" ] |
+ configs -= [ "//build/config/compiler:chromium_code" ] |
+ configs += [ "//build/config/compiler:no_chromium_code" ] |
+ if (is_win) { |
+ cflags = [ "/arch:AVX2" ] |
+ } else { |
+ cflags = [ "-mavx2" ] |
+ } |
+ if (current_cpu == "x86") { |
+ sources = vp9_libvpx_srcs_x86_avx2 |
+ } else if (current_cpu == "x64") { |
+ sources = vp9_libvpx_srcs_x86_64_avx2 |
+ } |
+} |
+static_library("vpx_dsp_libvpx_intrinsics_avx2") { |
+ configs += [ ":libvpx_config" ] |
+ configs -= [ "//build/config/compiler:chromium_code" ] |
+ configs += [ "//build/config/compiler:no_chromium_code" ] |
+ if (is_win) { |
+ cflags = [ "/arch:AVX2" ] |
+ } else { |
+ cflags = [ "-mavx2" ] |
+ } |
+ if (current_cpu == "x86") { |
+ sources = vpx_dsp_libvpx_srcs_x86_avx2 |
+ } else if (current_cpu == "x64") { |
+ sources = vpx_dsp_libvpx_srcs_x86_64_avx2 |
} |
} |
if (cpu_arch_full == "arm-neon-cpu-detect") { |
- static_library("libvpx_intrinsics_neon") { |
+ static_library("vp8_libvpx_intrinsics_neon") { |
+ configs -= [ "//build/config/compiler:compiler_arm_fpu" ] |
+ configs += [ ":libvpx_config" ] |
+ cflags = [ "-mfpu=neon" ] |
+ sources = vp8_libvpx_srcs_arm_neon_cpu_detect_neon |
+ } |
+} |
+if (cpu_arch_full == "arm-neon-cpu-detect") { |
+ static_library("vp9_libvpx_intrinsics_neon") { |
+ configs -= [ "//build/config/compiler:compiler_arm_fpu" ] |
+ configs += [ ":libvpx_config" ] |
+ cflags = [ "-mfpu=neon" ] |
+ sources = vp9_libvpx_srcs_arm_neon_cpu_detect_neon |
+ } |
+} |
+if (cpu_arch_full == "arm-neon-cpu-detect") { |
+ static_library("vpx_dsp_libvpx_intrinsics_neon") { |
configs -= [ "//build/config/compiler:compiler_arm_fpu" ] |
configs += [ ":libvpx_config" ] |
cflags = [ "-mfpu=neon" ] |
- sources = libvpx_srcs_arm_neon_cpu_detect_neon |
+ sources = vpx_dsp_libvpx_srcs_arm_neon_cpu_detect_neon |
} |
} |
# Converts ARM assembly files to GAS style. |
+# Not broken apart by vp8/vp9/vpx_dsp because we don't anticipate adding any |
+# new files of this kind. |
if (current_cpu == "arm") { |
action_foreach("convert_arm_assembly") { |
script = "//third_party/libvpx/run_perl.py" |
if (cpu_arch_full == "arm-neon") { |
- sources = libvpx_srcs_arm_neon_assembly |
+ sources = vp8_libvpx_srcs_arm_neon_assembly |
+ sources += vp9_libvpx_srcs_arm_neon_assembly |
+ sources += vpx_dsp_libvpx_srcs_arm_neon_assembly |
} else if (cpu_arch_full == "arm-neon-cpu-detect") { |
- sources = libvpx_srcs_arm_neon_cpu_detect_assembly |
+ sources = vp8_libvpx_srcs_arm_neon_cpu_detect_assembly |
+ sources += vp9_libvpx_srcs_arm_neon_cpu_detect_assembly |
+ sources += vpx_dsp_libvpx_srcs_arm_neon_cpu_detect_assembly |
} else { |
- sources = libvpx_srcs_arm_assembly |
+ sources = vp8_libvpx_srcs_arm_assembly |
+ sources += vp9_libvpx_srcs_arm_assembly |
+ sources += vpx_dsp_libvpx_srcs_arm_assembly |
} |
outputs = [ "$target_gen_dir/{{source_name_part}}.S" ] |
args = [ |
@@ -197,6 +402,109 @@ config("libvpx_warnings") { |
} |
} |
+static_library("vp8") { |
+ if (!is_debug && is_win && is_official_build) { |
+ configs -= [ "//build/config/compiler:optimize" ] |
+ configs += [ "//build/config/compiler:optimize_max" ] |
+ } |
+ |
+ if (current_cpu == "x86") { |
+ sources = vp8_libvpx_srcs_x86 |
+ } else if (current_cpu == "x64") { |
+ if (is_msan) { |
+ sources = vp8_libvpx_srcs_generic |
+ } else { |
+ sources = vp8_libvpx_srcs_x86_64 |
+ } |
+ } else if (current_cpu == "mipsel") { |
+ sources = vp8_libvpx_srcs_mips |
+ } else if (current_cpu == "arm") { |
+ if (arm_use_neon) { |
+ sources = vp8_libvpx_srcs_arm_neon |
+ } else if (is_android) { |
+ sources = vp8_libvpx_srcs_arm_neon_cpu_detect |
+ } else { |
+ sources = vp8_libvpx_srcs_arm |
+ } |
+ } else if (current_cpu == "arm64") { |
+ sources = vp8_libvpx_srcs_arm64 |
+ } |
+ |
+ configs += [ ":libvpx_config" ] |
+ configs -= [ "//build/config/compiler:chromium_code" ] |
+ configs += [ "//build/config/compiler:no_chromium_code" ] |
+ configs += [ ":libvpx_warnings" ] |
+ public_configs = [ ":libvpx_external_config" ] |
+} |
+static_library("vp9") { |
+ if (!is_debug && is_win && is_official_build) { |
+ configs -= [ "//build/config/compiler:optimize" ] |
+ configs += [ "//build/config/compiler:optimize_max" ] |
+ } |
+ |
+ if (current_cpu == "x86") { |
+ sources = vp9_libvpx_srcs_x86 |
+ } else if (current_cpu == "x64") { |
+ if (is_msan) { |
+ sources = vp9_libvpx_srcs_generic |
+ } else { |
+ sources = vp9_libvpx_srcs_x86_64 |
+ } |
+ } else if (current_cpu == "mipsel") { |
+ sources = vp9_libvpx_srcs_mips |
+ } else if (current_cpu == "arm") { |
+ if (arm_use_neon) { |
+ sources = vp9_libvpx_srcs_arm_neon |
+ } else if (is_android) { |
+ sources = vp9_libvpx_srcs_arm_neon_cpu_detect |
+ } else { |
+ sources = vp9_libvpx_srcs_arm |
+ } |
+ } else if (current_cpu == "arm64") { |
+ sources = vp9_libvpx_srcs_arm64 |
+ } |
+ |
+ configs += [ ":libvpx_config" ] |
+ configs -= [ "//build/config/compiler:chromium_code" ] |
+ configs += [ "//build/config/compiler:no_chromium_code" ] |
+ configs += [ ":libvpx_warnings" ] |
+ public_configs = [ ":libvpx_external_config" ] |
+} |
+static_library("vpx_dsp") { |
+ if (!is_debug && is_win && is_official_build) { |
+ configs -= [ "//build/config/compiler:optimize" ] |
+ configs += [ "//build/config/compiler:optimize_max" ] |
+ } |
+ |
+ if (current_cpu == "x86") { |
+ sources = vpx_dsp_libvpx_srcs_x86 |
+ } else if (current_cpu == "x64") { |
+ if (is_msan) { |
+ sources = vpx_dsp_libvpx_srcs_generic |
+ } else { |
+ sources = vpx_dsp_libvpx_srcs_x86_64 |
+ } |
+ } else if (current_cpu == "mipsel") { |
+ sources = vpx_dsp_libvpx_srcs_mips |
+ } else if (current_cpu == "arm") { |
+ if (arm_use_neon) { |
+ sources = vpx_dsp_libvpx_srcs_arm_neon |
+ } else if (is_android) { |
+ sources = vpx_dsp_libvpx_srcs_arm_neon_cpu_detect |
+ } else { |
+ sources = vpx_dsp_libvpx_srcs_arm |
+ } |
+ } else if (current_cpu == "arm64") { |
+ sources = vpx_dsp_libvpx_srcs_arm64 |
+ } |
+ |
+ configs += [ ":libvpx_config" ] |
+ configs -= [ "//build/config/compiler:chromium_code" ] |
+ configs += [ "//build/config/compiler:no_chromium_code" ] |
+ configs += [ ":libvpx_warnings" ] |
+ public_configs = [ ":libvpx_external_config" ] |
+} |
+ |
static_library("libvpx") { |
if (!is_debug && is_win && is_official_build) { |
configs -= [ "//build/config/compiler:optimize" ] |
@@ -232,22 +540,46 @@ static_library("libvpx") { |
deps = [] |
if (current_cpu == "x86" || (current_cpu == "x64" && !is_msan)) { |
deps += [ |
+ ":vp8", |
+ ":vp9", |
+ ":vpx_dsp", |
":libvpx_yasm", |
- ":libvpx_intrinsics_mmx", |
- ":libvpx_intrinsics_sse2", |
- ":libvpx_intrinsics_ssse3", |
- ":libvpx_intrinsics_sse4_1", |
- ":libvpx_intrinsics_avx2", |
+ ":vp8_libvpx_yasm", |
+ ":vp9_libvpx_yasm", |
+ ":vpx_dsp_libvpx_yasm", |
+ ":vp8_libvpx_intrinsics_mmx", |
+ ":vp9_libvpx_intrinsics_mmx", |
+ ":vpx_dsp_libvpx_intrinsics_mmx", |
+ ":vp8_libvpx_intrinsics_sse2", |
+ ":vp9_libvpx_intrinsics_sse2", |
+ ":vpx_dsp_libvpx_intrinsics_sse2", |
+ ":vp8_libvpx_intrinsics_ssse3", |
+ ":vp9_libvpx_intrinsics_ssse3", |
+ ":vpx_dsp_libvpx_intrinsics_ssse3", |
+ ":vp8_libvpx_intrinsics_sse4_1", |
+ ":vp9_libvpx_intrinsics_sse4_1", |
+ ":vpx_dsp_libvpx_intrinsics_sse4_1", |
+ ":vp8_libvpx_intrinsics_avx2", |
+ ":vp9_libvpx_intrinsics_avx2", |
+ ":vpx_dsp_libvpx_intrinsics_avx2", |
] |
} |
if (cpu_arch_full == "arm-neon-cpu-detect") { |
- deps += [ ":libvpx_intrinsics_neon" ] |
+ deps += [ |
+ ":vp8_libvpx_intrinsics_neon", |
+ ":vp9_libvpx_intrinsics_neon", |
+ ":vpx_dsp_libvpx_intrinsics_neon", |
+ ] |
} |
if (is_android) { |
deps += [ "//third_party/android_tools:cpu_features" ] |
} |
if (current_cpu == "arm") { |
- deps += [ ":libvpx_assembly_arm" ] |
+ deps += [ |
+ ":vp8_libvpx_assembly_arm", |
+ ":vp9_libvpx_assembly_arm", |
+ ":vpx_dsp_libvpx_assembly_arm", |
+ ] |
} |
public_configs = [ ":libvpx_external_config" ] |