OLD | NEW |
---|---|
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/chrome_build.gni") | 7 import("//build/config/chrome_build.gni") |
8 import("//third_party/libvpx/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 if (is_posix && !is_mac) { | |
12 os_category = "linux" | |
13 } else { | |
14 os_category = current_os | |
15 } | |
16 | |
17 # Sets the architecture name for building libvpx. | 11 # Sets the architecture name for building libvpx. |
18 if (current_cpu == "x86") { | 12 if (current_cpu == "x86") { |
19 cpu_arch_full = "ia32" | 13 cpu_arch_full = "ia32" |
20 } else if (current_cpu == "x64") { | 14 } else if (current_cpu == "x64") { |
21 if (is_msan) { | 15 if (is_msan) { |
22 cpu_arch_full = "generic" | 16 cpu_arch_full = "generic" |
23 } else { | 17 } else { |
24 cpu_arch_full = "x64" | 18 cpu_arch_full = "x64" |
25 } | 19 } |
26 } else if (current_cpu == "arm") { | 20 } else if (current_cpu == "arm") { |
27 if (arm_use_neon) { | 21 if (arm_use_neon) { |
28 cpu_arch_full = "arm-neon" | 22 cpu_arch_full = "arm-neon" |
29 } else if (is_android) { | 23 } else if (is_android) { |
30 cpu_arch_full = "arm-neon-cpu-detect" | 24 cpu_arch_full = "arm-neon-cpu-detect" |
31 } else { | 25 } else { |
32 cpu_arch_full = "arm" | 26 cpu_arch_full = "arm" |
33 } | 27 } |
34 } else { | 28 } else { |
35 cpu_arch_full = current_cpu | 29 cpu_arch_full = current_cpu |
36 } | 30 } |
37 | 31 |
32 if (is_nacl) { | |
33 platform_include_dir = "//third_party/libvpx/source/config/nacl" | |
34 } else { | |
35 if (is_posix && !is_mac) { | |
36 os_category = "linux" | |
37 } else { | |
38 os_category = current_os | |
39 } | |
40 platform_include_dir = | |
41 "//third_party/libvpx/source/config/$os_category/$cpu_arch_full" | |
Johann
2015/09/03 05:43:03
ah, ok this moved so you have $cpu_arch_full defin
Sergey Ulanov
2015/09/03 16:33:37
GN doesn't allow to define variable and never use
| |
42 } | |
43 | |
38 config("libvpx_config") { | 44 config("libvpx_config") { |
39 include_dirs = [ | 45 include_dirs = [ |
40 "//third_party/libvpx/source/config", | 46 "//third_party/libvpx/source/config", |
41 "//third_party/libvpx/source/config/$os_category/$cpu_arch_full", | 47 platform_include_dir, |
Johann
2015/09/03 05:43:03
$platform_include_dir?
Sergey Ulanov
2015/09/03 16:33:37
this can be either platform_include_dir or "$platf
Johann
2015/09/03 16:41:45
Weird. OK!
| |
42 "//third_party/libvpx/source/libvpx", | 48 "//third_party/libvpx/source/libvpx", |
43 "$root_gen_dir/third_party/libvpx", # Provides vpx_rtcd.h. | 49 "$root_gen_dir/third_party/libvpx", # Provides vpx_rtcd.h. |
44 ] | 50 ] |
45 } | 51 } |
46 | 52 |
47 # gn orders flags on a target before flags from configs. The default config | 53 # gn orders flags on a target before flags from configs. The default config |
48 # adds -Wall, and these flags have to be after -Wall -- so they need to come | 54 # adds -Wall, and these flags have to be after -Wall -- so they need to come |
49 # from a config and can't be on the target directly. | 55 # from a config and can't be on the target directly. |
50 config("libvpx_warnings") { | 56 config("libvpx_warnings") { |
51 if (is_clang) { | 57 if (is_clang) { |
(...skipping 20 matching lines...) Expand all Loading... | |
72 if (current_cpu == "x86" || current_cpu == "x64") { | 78 if (current_cpu == "x86" || current_cpu == "x64") { |
73 yasm_assemble("libvpx_yasm") { | 79 yasm_assemble("libvpx_yasm") { |
74 if (current_cpu == "x86") { | 80 if (current_cpu == "x86") { |
75 sources = libvpx_srcs_x86_assembly | 81 sources = libvpx_srcs_x86_assembly |
76 } else if (current_cpu == "x64") { | 82 } else if (current_cpu == "x64") { |
77 sources = libvpx_srcs_x86_64_assembly | 83 sources = libvpx_srcs_x86_64_assembly |
78 } | 84 } |
79 | 85 |
80 defines = [ "CHROMIUM" ] | 86 defines = [ "CHROMIUM" ] |
81 include_dirs = [ | 87 include_dirs = [ |
82 "//third_party/libvpx/source/config/$os_category/$cpu_arch_full", | 88 platform_include_dir, |
83 "//third_party/libvpx/source/config", | 89 "//third_party/libvpx/source/config", |
84 "//third_party/libvpx/source/libvpx", | 90 "//third_party/libvpx/source/libvpx", |
85 target_gen_dir | 91 target_gen_dir |
86 ] | 92 ] |
87 } | 93 } |
88 } | 94 } |
89 | 95 |
90 static_library("libvpx_intrinsics_mmx") { | 96 static_library("libvpx_intrinsics_mmx") { |
91 configs += [ ":libvpx_config" ] | 97 configs += [ ":libvpx_config" ] |
92 configs -= [ "//build/config/compiler:chromium_code" ] | 98 configs -= [ "//build/config/compiler:chromium_code" ] |
93 configs += [ "//build/config/compiler:no_chromium_code" ] | 99 configs += [ "//build/config/compiler:no_chromium_code" ] |
94 configs += [ ":libvpx_warnings" ] | 100 configs += [ ":libvpx_warnings" ] |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
209 ] | 215 ] |
210 } | 216 } |
211 } | 217 } |
212 | 218 |
213 static_library("libvpx") { | 219 static_library("libvpx") { |
214 if (!is_debug && is_win && is_official_build) { | 220 if (!is_debug && is_win && is_official_build) { |
215 configs -= [ "//build/config/compiler:optimize" ] | 221 configs -= [ "//build/config/compiler:optimize" ] |
216 configs += [ "//build/config/compiler:optimize_max" ] | 222 configs += [ "//build/config/compiler:optimize_max" ] |
217 } | 223 } |
218 | 224 |
219 if (current_cpu == "x86") { | 225 if (is_nacl) { |
226 sources = libvpx_srcs_generic | |
227 } else if (current_cpu == "x86") { | |
220 sources = libvpx_srcs_x86 | 228 sources = libvpx_srcs_x86 |
221 } else if (current_cpu == "x64") { | 229 } else if (current_cpu == "x64") { |
222 if (is_msan) { | 230 if (is_msan) { |
223 sources = libvpx_srcs_generic | 231 sources = libvpx_srcs_generic |
224 } else { | 232 } else { |
225 sources = libvpx_srcs_x86_64 | 233 sources = libvpx_srcs_x86_64 |
226 } | 234 } |
227 } else if (current_cpu == "mipsel") { | 235 } else if (current_cpu == "mipsel") { |
228 sources = libvpx_srcs_mips | 236 sources = libvpx_srcs_mips |
229 } else if (current_cpu == "arm") { | 237 } else if (current_cpu == "arm") { |
(...skipping 28 matching lines...) Expand all Loading... | |
258 } | 266 } |
259 if (is_android) { | 267 if (is_android) { |
260 deps += [ "//third_party/android_tools:cpu_features" ] | 268 deps += [ "//third_party/android_tools:cpu_features" ] |
261 } | 269 } |
262 if (current_cpu == "arm") { | 270 if (current_cpu == "arm") { |
263 deps += [ ":libvpx_assembly_arm" ] | 271 deps += [ ":libvpx_assembly_arm" ] |
264 } | 272 } |
265 | 273 |
266 public_configs = [ ":libvpx_external_config" ] | 274 public_configs = [ ":libvpx_external_config" ] |
267 } | 275 } |
OLD | NEW |