Chromium Code Reviews| 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) { | 11 if (is_posix && !is_mac) { |
| 12 os_category = "linux" | 12 os_category = "linux" |
| 13 } if (is_nacl) { | |
|
Johann
2015/09/03 02:14:51
this doesn't seem necessary, but if you want to ke
Sergey Ulanov
2015/09/03 04:25:20
Actually with your other suggestion below os_categ
| |
| 14 os_category = "nacl" | |
| 13 } else { | 15 } else { |
| 14 os_category = current_os | 16 os_category = current_os |
| 15 } | 17 } |
| 16 | 18 |
| 17 # Sets the architecture name for building libvpx. | 19 # Sets the architecture name for building libvpx. |
| 18 if (current_cpu == "x86") { | 20 if (current_cpu == "x86") { |
| 19 cpu_arch_full = "ia32" | 21 cpu_arch_full = "ia32" |
| 20 } else if (current_cpu == "x64") { | 22 } else if (current_cpu == "x64") { |
| 21 if (is_msan) { | 23 if (is_msan) { |
| 22 cpu_arch_full = "generic" | 24 cpu_arch_full = "generic" |
| 23 } else { | 25 } else { |
| 24 cpu_arch_full = "x64" | 26 cpu_arch_full = "x64" |
| 25 } | 27 } |
| 26 } else if (current_cpu == "arm") { | 28 } else if (current_cpu == "arm") { |
| 27 if (arm_use_neon) { | 29 if (arm_use_neon) { |
| 28 cpu_arch_full = "arm-neon" | 30 cpu_arch_full = "arm-neon" |
| 29 } else if (is_android) { | 31 } else if (is_android) { |
| 30 cpu_arch_full = "arm-neon-cpu-detect" | 32 cpu_arch_full = "arm-neon-cpu-detect" |
| 31 } else { | 33 } else { |
| 32 cpu_arch_full = "arm" | 34 cpu_arch_full = "arm" |
| 33 } | 35 } |
| 34 } else { | 36 } else { |
| 35 cpu_arch_full = current_cpu | 37 cpu_arch_full = current_cpu |
| 36 } | 38 } |
| 37 | 39 |
| 40 if (os_category == "nacl") { | |
|
Johann
2015/09/03 02:14:51
this could be if(is_nacl), yeah?
Sergey Ulanov
2015/09/03 04:25:20
Done.
| |
| 41 platform_include_dir = | |
| 42 "//third_party/libvpx/source/config/$os_category" | |
|
Johann
2015/09/03 02:14:51
this could be hard coded source/config/nacl
Sergey Ulanov
2015/09/03 04:25:20
Done.
| |
| 43 } else { | |
| 44 platform_include_dir = | |
| 45 "//third_party/libvpx/source/config/$os_category/$cpu_arch_full" | |
| 46 } | |
| 47 | |
| 38 config("libvpx_config") { | 48 config("libvpx_config") { |
| 39 include_dirs = [ | 49 include_dirs = [ |
| 40 "//third_party/libvpx/source/config", | 50 "//third_party/libvpx/source/config", |
| 41 "//third_party/libvpx/source/config/$os_category/$cpu_arch_full", | 51 platform_include_dir, |
| 42 "//third_party/libvpx/source/libvpx", | 52 "//third_party/libvpx/source/libvpx", |
| 43 "$root_gen_dir/third_party/libvpx", # Provides vpx_rtcd.h. | 53 "$root_gen_dir/third_party/libvpx", # Provides vpx_rtcd.h. |
| 44 ] | 54 ] |
| 45 } | 55 } |
| 46 | 56 |
| 47 # gn orders flags on a target before flags from configs. The default config | 57 # 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 | 58 # 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. | 59 # from a config and can't be on the target directly. |
| 50 config("libvpx_warnings") { | 60 config("libvpx_warnings") { |
| 51 if (is_clang) { | 61 if (is_clang) { |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 70 if (current_cpu == "x86" || current_cpu == "x64") { | 80 if (current_cpu == "x86" || current_cpu == "x64") { |
| 71 yasm_assemble("libvpx_yasm") { | 81 yasm_assemble("libvpx_yasm") { |
| 72 if (current_cpu == "x86") { | 82 if (current_cpu == "x86") { |
| 73 sources = libvpx_srcs_x86_assembly | 83 sources = libvpx_srcs_x86_assembly |
| 74 } else if (current_cpu == "x64") { | 84 } else if (current_cpu == "x64") { |
| 75 sources = libvpx_srcs_x86_64_assembly | 85 sources = libvpx_srcs_x86_64_assembly |
| 76 } | 86 } |
| 77 | 87 |
| 78 defines = [ "CHROMIUM" ] | 88 defines = [ "CHROMIUM" ] |
| 79 include_dirs = [ | 89 include_dirs = [ |
| 80 "//third_party/libvpx/source/config/$os_category/$cpu_arch_full", | 90 platform_include_dir, |
| 81 "//third_party/libvpx/source/config", | 91 "//third_party/libvpx/source/config", |
| 82 "//third_party/libvpx/source/libvpx", | 92 "//third_party/libvpx/source/libvpx", |
| 83 target_gen_dir | 93 target_gen_dir |
| 84 ] | 94 ] |
| 85 } | 95 } |
| 86 } | 96 } |
| 87 | 97 |
| 88 static_library("libvpx_intrinsics_mmx") { | 98 static_library("libvpx_intrinsics_mmx") { |
| 89 configs += [ ":libvpx_config" ] | 99 configs += [ ":libvpx_config" ] |
| 90 configs -= [ "//build/config/compiler:chromium_code" ] | 100 configs -= [ "//build/config/compiler:chromium_code" ] |
| 91 configs += [ "//build/config/compiler:no_chromium_code" ] | 101 configs += [ "//build/config/compiler:no_chromium_code" ] |
| 92 configs += [ ":libvpx_warnings" ] | 102 configs += [ ":libvpx_warnings" ] |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 207 ] | 217 ] |
| 208 } | 218 } |
| 209 } | 219 } |
| 210 | 220 |
| 211 static_library("libvpx") { | 221 static_library("libvpx") { |
| 212 if (!is_debug && is_win && is_official_build) { | 222 if (!is_debug && is_win && is_official_build) { |
| 213 configs -= [ "//build/config/compiler:optimize" ] | 223 configs -= [ "//build/config/compiler:optimize" ] |
| 214 configs += [ "//build/config/compiler:optimize_max" ] | 224 configs += [ "//build/config/compiler:optimize_max" ] |
| 215 } | 225 } |
| 216 | 226 |
| 217 if (current_cpu == "x86") { | 227 if (is_nacl) { |
| 228 sources = libvpx_srcs_generic | |
| 229 } if (current_cpu == "x86") { | |
|
Johann
2015/09/03 02:14:51
else if?
Sergey Ulanov
2015/09/03 04:25:20
Yes, of course! Thanks for catching it!
| |
| 218 sources = libvpx_srcs_x86 | 230 sources = libvpx_srcs_x86 |
| 219 } else if (current_cpu == "x64") { | 231 } else if (current_cpu == "x64") { |
| 220 if (is_msan) { | 232 if (is_msan) { |
| 221 sources = libvpx_srcs_generic | 233 sources = libvpx_srcs_generic |
| 222 } else { | 234 } else { |
| 223 sources = libvpx_srcs_x86_64 | 235 sources = libvpx_srcs_x86_64 |
| 224 } | 236 } |
| 225 } else if (current_cpu == "mipsel") { | 237 } else if (current_cpu == "mipsel") { |
| 226 sources = libvpx_srcs_mips | 238 sources = libvpx_srcs_mips |
| 227 } else if (current_cpu == "arm") { | 239 } else if (current_cpu == "arm") { |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 256 } | 268 } |
| 257 if (is_android) { | 269 if (is_android) { |
| 258 deps += [ "//third_party/android_tools:cpu_features" ] | 270 deps += [ "//third_party/android_tools:cpu_features" ] |
| 259 } | 271 } |
| 260 if (current_cpu == "arm") { | 272 if (current_cpu == "arm") { |
| 261 deps += [ ":libvpx_assembly_arm" ] | 273 deps += [ ":libvpx_assembly_arm" ] |
| 262 } | 274 } |
| 263 | 275 |
| 264 public_configs = [ ":libvpx_external_config" ] | 276 public_configs = [ ":libvpx_external_config" ] |
| 265 } | 277 } |
| OLD | NEW |