Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(27)

Unified Diff: third_party/libvpx/BUILD.gn

Issue 1158913006: Move libvpx from DEPS to src (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add DEPS file with #include paths Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « WATCHLISTS ('k') | third_party/libvpx/DEPS » ('j') | third_party/libvpx/DEPS » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/libvpx/BUILD.gn
diff --git a/third_party/libvpx/BUILD.gn b/third_party/libvpx/BUILD.gn
new file mode 100644
index 0000000000000000000000000000000000000000..bb55816b80bc13af5018c65e661746f740cafcbb
--- /dev/null
+++ b/third_party/libvpx/BUILD.gn
@@ -0,0 +1,253 @@
+# Copyright 2014 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import("//build/config/arm.gni")
+import("//build/config/android/config.gni")
+import("//third_party/libvpx/libvpx_srcs.gni")
+import("//third_party/yasm/yasm_assemble.gni")
+
+if (is_posix && !is_mac) {
+ os_category = "linux"
+} else {
+ os_category = current_os
+}
+
+# Sets the architecture name for building libvpx.
+if (current_cpu == "x86") {
+ cpu_arch_full = "ia32"
+} else if (current_cpu == "x64") {
+ if (is_msan) {
+ cpu_arch_full = "generic"
+ } else {
+ cpu_arch_full = "x64"
+ }
+} else if (current_cpu == "arm") {
+ if (arm_use_neon) {
+ cpu_arch_full = "arm-neon"
+ } else if (is_android) {
+ cpu_arch_full = "arm-neon-cpu-detect"
+ } else {
+ cpu_arch_full = "arm"
+ }
+} else {
+ cpu_arch_full = current_cpu
+}
+
+config("libvpx_config") {
+ include_dirs = [
+ "//third_party/libvpx/source/config",
+ "//third_party/libvpx/source/config/$os_category/$cpu_arch_full",
+ "//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" ]
+ }
+}
+
+# This config is applied to targets that depend on libvpx.
+config("libvpx_external_config") {
+ include_dirs = [
+ "//third_party/libvpx/source/libvpx",
+ ]
+}
+
+if (current_cpu == "x86" || current_cpu == "x64") {
+ yasm_assemble("libvpx_yasm") {
+ if (current_cpu == "x86") {
+ sources = libvpx_srcs_x86_assembly
+ } else if (current_cpu == "x64") {
+ sources = 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") {
+ 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 = libvpx_srcs_x86_mmx
+ } else if (current_cpu == "x64") {
+ sources = libvpx_srcs_x86_64_mmx
+ }
+}
+
+static_library("libvpx_intrinsics_sse2") {
+ configs += [ ":libvpx_config" ]
+ configs -= [ "//build/config/compiler:chromium_code" ]
+ configs += [ "//build/config/compiler:no_chromium_code" ]
+ if (!is_win) {
+ cflags = [ "-msse2" ]
+ }
+ if (current_cpu == "x86") {
+ sources = libvpx_srcs_x86_sse2
+ } else if (current_cpu == "x64") {
+ sources = libvpx_srcs_x86_64_sse2
+ }
+}
+
+static_library("libvpx_intrinsics_ssse3") {
+ configs += [ ":libvpx_config" ]
+ configs -= [ "//build/config/compiler:chromium_code" ]
+ configs += [ "//build/config/compiler:no_chromium_code" ]
+ if (!is_win) {
+ cflags = [ "-mssse3" ]
+ }
+ if (current_cpu == "x86") {
+ sources = libvpx_srcs_x86_ssse3
+ } else if (current_cpu == "x64") {
+ sources = libvpx_srcs_x86_64_ssse3
+ }
+}
+
+static_library("libvpx_intrinsics_sse4_1") {
+ configs += [ ":libvpx_config" ]
+ configs -= [ "//build/config/compiler:chromium_code" ]
+ configs += [ "//build/config/compiler:no_chromium_code" ]
+ if (!is_win) {
+ cflags = [ "-msse4.1" ]
+ }
+ if (current_cpu == "x86") {
+ sources = libvpx_srcs_x86_sse4_1
+ } else if (current_cpu == "x64") {
+ sources = libvpx_srcs_x86_64_sse4_1
+ }
+}
+
+static_library("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 = libvpx_srcs_x86_avx2
+ } else if (current_cpu == "x64") {
+ sources = libvpx_srcs_x86_64_avx2
+ }
+}
+
+if (cpu_arch_full == "arm-neon-cpu-detect") {
+ static_library("libvpx_intrinsics_neon") {
+ configs -= [ "//build/config/compiler:compiler_arm_fpu" ]
+ configs += [ ":libvpx_config" ]
+ cflags = [ "-mfpu=neon" ]
+ sources = libvpx_srcs_arm_neon_cpu_detect_neon
+ }
+}
+
+# Converts ARM assembly files to GAS style.
+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
+ } else if (cpu_arch_full == "arm-neon-cpu-detect") {
+ sources = libvpx_srcs_arm_neon_cpu_detect_assembly
+ } else {
+ sources = libvpx_srcs_arm_assembly
+ }
+ outputs = [ "$target_gen_dir/{{source_name_part}}.S" ]
+ args = [
+ "-s",
+ rebase_path("//third_party/libvpx/source/libvpx/build/make/ads2gas.pl",
+ root_build_dir),
+ "-i", "{{source}}",
+ "-o", rebase_path("$target_gen_dir/{{source_name_part}}.S")
+ ]
+ }
+
+ static_library("libvpx_assembly_arm") {
+ sources = get_target_outputs(":convert_arm_assembly")
+ configs -= [ "//build/config/compiler:compiler_arm_fpu" ]
+ configs += [ ":libvpx_config" ]
+ if (cpu_arch_full == "arm-neon" ||
+ cpu_arch_full == "arm-neon-cpu-detect") {
+ cflags = [ "-mfpu=neon" ]
+ }
+ deps = [
+ ":convert_arm_assembly",
+ ]
+ }
+}
+
+static_library("libvpx") {
+ if (!is_debug && is_win && is_official_build) {
+ configs -= [ "//build/config/compiler:optimize" ]
+ configs += [ "//build/config/compiler:optimize_max" ]
+ }
+
+ if (current_cpu == "x86") {
+ sources = libvpx_srcs_x86
+ } else if (current_cpu == "x64") {
+ if (is_msan) {
+ sources = libvpx_srcs_generic
+ } else {
+ sources = libvpx_srcs_x86_64
+ }
+ } else if (current_cpu == "mipsel") {
+ sources = libvpx_srcs_mips
+ } else if (current_cpu == "arm") {
+ if (arm_use_neon) {
+ sources = libvpx_srcs_arm_neon
+ } else if (is_android) {
+ sources = libvpx_srcs_arm_neon_cpu_detect
+ } else {
+ sources = libvpx_srcs_arm
+ }
+ } else if (current_cpu == "arm64") {
+ sources = libvpx_srcs_arm64
+ }
+
+ # 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" ]
+ }
+ }
+
+ configs += [ ":libvpx_config" ]
+ configs -= [ "//build/config/compiler:chromium_code" ]
+ configs += [ "//build/config/compiler:no_chromium_code" ]
+ configs += [ ":libvpx_warnings" ]
+ deps = []
+ if (current_cpu == "x86" || (current_cpu == "x64" && !is_msan)) {
+ deps += [
+ ":libvpx_yasm",
+ ":libvpx_intrinsics_mmx",
+ ":libvpx_intrinsics_sse2",
+ ":libvpx_intrinsics_ssse3",
+ ":libvpx_intrinsics_sse4_1",
+ ":libvpx_intrinsics_avx2",
+ ]
+ }
+ if (cpu_arch_full == "arm-neon-cpu-detect") {
+ deps += [ ":libvpx_intrinsics_neon" ]
+ }
+ if (is_android) {
+ deps += [ "//third_party/android_tools:cpu_features" ]
+ }
+ if (current_cpu == "arm") {
+ deps += [ ":libvpx_assembly_arm" ]
+ }
+
+ public_configs = [ ":libvpx_external_config" ]
+}
« no previous file with comments | « WATCHLISTS ('k') | third_party/libvpx/DEPS » ('j') | third_party/libvpx/DEPS » ('J')

Powered by Google App Engine
This is Rietveld 408576698