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

Side by Side Diff: third_party/libvpx/BUILD.gn

Issue 1734613003: Move libvpx_new to libvpx (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 9 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 unified diff | Download patch
« no previous file with comments | « remoting/remoting_nacl.gyp ('k') | third_party/libvpx/DEPS » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import("//build/config/arm.gni") 5 import("//build/config/arm.gni")
6 import("//build/config/android/config.gni") 6 import("//build/config/android/config.gni")
7 import("//build/config/sanitizers/sanitizers.gni") 7 import("//build/config/sanitizers/sanitizers.gni")
8 import("//third_party/libvpx_new/libvpx_srcs.gni") 8 import("//third_party/libvpx/libvpx_srcs.gni")
9 import("//third_party/yasm/yasm_assemble.gni") 9 import("//third_party/yasm/yasm_assemble.gni")
10 10
11 # Sets the architecture name for building libvpx. 11 # Sets the architecture name for building libvpx.
12 if (current_cpu == "x86") { 12 if (current_cpu == "x86") {
13 cpu_arch_full = "ia32" 13 cpu_arch_full = "ia32"
14 } else if (current_cpu == "x64") { 14 } else if (current_cpu == "x64") {
15 if (is_msan) { 15 if (is_msan) {
16 cpu_arch_full = "generic" 16 cpu_arch_full = "generic"
17 } else { 17 } else {
18 cpu_arch_full = "x64" 18 cpu_arch_full = "x64"
19 } 19 }
20 } else if (current_cpu == "arm") { 20 } else if (current_cpu == "arm") {
21 if (arm_use_neon) { 21 if (arm_use_neon) {
22 cpu_arch_full = "arm-neon" 22 cpu_arch_full = "arm-neon"
23 } else if (is_android) { 23 } else if (is_android) {
24 cpu_arch_full = "arm-neon-cpu-detect" 24 cpu_arch_full = "arm-neon-cpu-detect"
25 } else { 25 } else {
26 cpu_arch_full = "arm" 26 cpu_arch_full = "arm"
27 } 27 }
28 } else { 28 } else {
29 cpu_arch_full = current_cpu 29 cpu_arch_full = current_cpu
30 } 30 }
31 31
32 if (is_nacl) { 32 if (is_nacl) {
33 platform_include_dir = "//third_party/libvpx_new/source/config/nacl" 33 platform_include_dir = "//third_party/libvpx/source/config/nacl"
34 } else { 34 } else {
35 if (is_posix && !is_mac) { 35 if (is_posix && !is_mac) {
36 os_category = "linux" 36 os_category = "linux"
37 } else { 37 } else {
38 os_category = current_os 38 os_category = current_os
39 } 39 }
40 platform_include_dir = 40 platform_include_dir =
41 "//third_party/libvpx_new/source/config/$os_category/$cpu_arch_full" 41 "//third_party/libvpx/source/config/$os_category/$cpu_arch_full"
42 } 42 }
43 43
44 config("libvpx_config") { 44 config("libvpx_config") {
45 include_dirs = [ 45 include_dirs = [
46 "//third_party/libvpx_new/source/config", 46 "//third_party/libvpx/source/config",
47 platform_include_dir, 47 platform_include_dir,
48 "//third_party/libvpx_new/source/libvpx", 48 "//third_party/libvpx/source/libvpx",
49 "$root_gen_dir/third_party/libvpx_new", # Provides vpx_rtcd.h. 49 "$root_gen_dir/third_party/libvpx", # Provides vpx_rtcd.h.
50 ] 50 ]
51 51
52 if (current_cpu == "arm" && is_clang) { 52 if (current_cpu == "arm" && is_clang) {
53 # TODO(hans) Enable integrated-as (crbug.com/124610). 53 # TODO(hans) Enable integrated-as (crbug.com/124610).
54 asmflags = [ "-fno-integrated-as" ] 54 asmflags = [ "-fno-integrated-as" ]
55 if (is_android) { 55 if (is_android) {
56 rebased_android_toolchain_root = 56 rebased_android_toolchain_root =
57 rebase_path(android_toolchain_root, root_build_dir) 57 rebase_path(android_toolchain_root, root_build_dir)
58 58
59 # Else /usr/bin/as gets picked up. 59 # Else /usr/bin/as gets picked up.
(...skipping 20 matching lines...) Expand all
80 } else if (!is_win) { 80 } else if (!is_win) {
81 cflags = [ 81 cflags = [
82 "-Wno-unused-function", 82 "-Wno-unused-function",
83 "-Wno-sign-compare", 83 "-Wno-sign-compare",
84 ] 84 ]
85 } 85 }
86 } 86 }
87 87
88 # This config is applied to targets that depend on libvpx. 88 # This config is applied to targets that depend on libvpx.
89 config("libvpx_external_config") { 89 config("libvpx_external_config") {
90 include_dirs = [ "//third_party/libvpx_new/source/libvpx" ] 90 include_dirs = [ "//third_party/libvpx/source/libvpx" ]
91 } 91 }
92 92
93 if (current_cpu == "x86" || current_cpu == "x64") { 93 if (current_cpu == "x86" || current_cpu == "x64") {
94 yasm_assemble("libvpx_yasm") { 94 yasm_assemble("libvpx_yasm") {
95 if (current_cpu == "x86") { 95 if (current_cpu == "x86") {
96 sources = libvpx_srcs_x86_assembly 96 sources = libvpx_srcs_x86_assembly
97 } else if (current_cpu == "x64") { 97 } else if (current_cpu == "x64") {
98 sources = libvpx_srcs_x86_64_assembly 98 sources = libvpx_srcs_x86_64_assembly
99 } 99 }
100 100
101 defines = [ "CHROMIUM" ] 101 defines = [ "CHROMIUM" ]
102 if (is_android) { 102 if (is_android) {
103 # On Android, define __ANDROID__ to use alternative standard library 103 # On Android, define __ANDROID__ to use alternative standard library
104 # functions. 104 # functions.
105 defines += [ "__ANDROID__" ] 105 defines += [ "__ANDROID__" ]
106 } 106 }
107 include_dirs = [ 107 include_dirs = [
108 platform_include_dir, 108 platform_include_dir,
109 "//third_party/libvpx_new/source/config", 109 "//third_party/libvpx/source/config",
110 "//third_party/libvpx_new/source/libvpx", 110 "//third_party/libvpx/source/libvpx",
111 target_gen_dir, 111 target_gen_dir,
112 ] 112 ]
113 } 113 }
114 } 114 }
115 115
116 static_library("libvpx_intrinsics_mmx") { 116 static_library("libvpx_intrinsics_mmx") {
117 configs += [ ":libvpx_config" ] 117 configs += [ ":libvpx_config" ]
118 configs -= [ "//build/config/compiler:chromium_code" ] 118 configs -= [ "//build/config/compiler:chromium_code" ]
119 configs += [ "//build/config/compiler:no_chromium_code" ] 119 configs += [ "//build/config/compiler:no_chromium_code" ]
120 configs += [ ":libvpx_warnings" ] 120 configs += [ ":libvpx_warnings" ]
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 configs += [ ":libvpx_config" ] 213 configs += [ ":libvpx_config" ]
214 configs += [ ":libvpx_warnings" ] 214 configs += [ ":libvpx_warnings" ]
215 cflags = [ "-mfpu=neon" ] 215 cflags = [ "-mfpu=neon" ]
216 sources = libvpx_srcs_arm_neon_cpu_detect_neon 216 sources = libvpx_srcs_arm_neon_cpu_detect_neon
217 } 217 }
218 } 218 }
219 219
220 # Converts ARM assembly files to GAS style. 220 # Converts ARM assembly files to GAS style.
221 if (current_cpu == "arm") { 221 if (current_cpu == "arm") {
222 action_foreach("convert_arm_assembly") { 222 action_foreach("convert_arm_assembly") {
223 script = "//third_party/libvpx_new/run_perl.py" 223 script = "//third_party/libvpx/run_perl.py"
224 if (cpu_arch_full == "arm-neon") { 224 if (cpu_arch_full == "arm-neon") {
225 sources = libvpx_srcs_arm_neon_assembly 225 sources = libvpx_srcs_arm_neon_assembly
226 } else if (cpu_arch_full == "arm-neon-cpu-detect") { 226 } else if (cpu_arch_full == "arm-neon-cpu-detect") {
227 sources = libvpx_srcs_arm_neon_cpu_detect_assembly 227 sources = libvpx_srcs_arm_neon_cpu_detect_assembly
228 } else { 228 } else {
229 sources = libvpx_srcs_arm_assembly 229 sources = libvpx_srcs_arm_assembly
230 } 230 }
231 outputs = [ 231 outputs = [
232 "$target_gen_dir/{{source_name_part}}.S", 232 "$target_gen_dir/{{source_name_part}}.S",
233 ] 233 ]
234 args = [ 234 args = [
235 "-s", 235 "-s",
236 rebase_path( 236 rebase_path("//third_party/libvpx/source/libvpx/build/make/ads2gas.pl",
237 "//third_party/libvpx_new/source/libvpx/build/make/ads2gas.pl", 237 root_build_dir),
238 root_build_dir),
239 "-i", 238 "-i",
240 "{{source}}", 239 "{{source}}",
241 "-o", 240 "-o",
242 rebase_path("$target_gen_dir/{{source_name_part}}.S"), 241 rebase_path("$target_gen_dir/{{source_name_part}}.S"),
243 ] 242 ]
244 } 243 }
245 244
246 static_library("libvpx_assembly_arm") { 245 static_library("libvpx_assembly_arm") {
247 sources = get_target_outputs(":convert_arm_assembly") 246 sources = get_target_outputs(":convert_arm_assembly")
248 configs -= [ "//build/config/compiler:compiler_arm_fpu" ] 247 configs -= [ "//build/config/compiler:compiler_arm_fpu" ]
249 configs += [ ":libvpx_config" ] 248 configs += [ ":libvpx_config" ]
250 configs += [ ":libvpx_warnings" ] 249 configs += [ ":libvpx_warnings" ]
251 if (cpu_arch_full == "arm-neon" || cpu_arch_full == "arm-neon-cpu-detect") { 250 if (cpu_arch_full == "arm-neon" || cpu_arch_full == "arm-neon-cpu-detect") {
252 asmflags = [ "-mfpu=neon" ] 251 asmflags = [ "-mfpu=neon" ]
253 } 252 }
254 deps = [ 253 deps = [
255 ":convert_arm_assembly", 254 ":convert_arm_assembly",
256 ] 255 ]
257 } 256 }
258 } 257 }
259 258
260 static_library("libvpx_new") { 259 static_library("libvpx") {
261 if (!is_debug && is_win) { 260 if (!is_debug && is_win) {
262 configs -= [ "//build/config/compiler:default_optimization" ] 261 configs -= [ "//build/config/compiler:default_optimization" ]
263 configs += [ "//build/config/compiler:optimize_max" ] 262 configs += [ "//build/config/compiler:optimize_max" ]
264 } 263 }
265 264
266 if (is_nacl) { 265 if (is_nacl) {
267 sources = libvpx_srcs_generic 266 sources = libvpx_srcs_generic
268 } else if (current_cpu == "x86") { 267 } else if (current_cpu == "x86") {
269 sources = libvpx_srcs_x86 268 sources = libvpx_srcs_x86
270 } else if (current_cpu == "x64") { 269 } else if (current_cpu == "x64") {
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 } 307 }
309 if (is_android) { 308 if (is_android) {
310 deps += [ "//third_party/android_tools:cpu_features" ] 309 deps += [ "//third_party/android_tools:cpu_features" ]
311 } 310 }
312 if (current_cpu == "arm") { 311 if (current_cpu == "arm") {
313 deps += [ ":libvpx_assembly_arm" ] 312 deps += [ ":libvpx_assembly_arm" ]
314 } 313 }
315 314
316 public_configs = [ ":libvpx_external_config" ] 315 public_configs = [ ":libvpx_external_config" ]
317 } 316 }
OLDNEW
« no previous file with comments | « remoting/remoting_nacl.gyp ('k') | third_party/libvpx/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698