| 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("//third_party/libvpx/libvpx_srcs.gni") | 7 import("//third_party/libvpx/libvpx_srcs.gni") |
| 8 import("//third_party/yasm/yasm_assemble.gni") | 8 import("//third_party/yasm/yasm_assemble.gni") |
| 9 | 9 |
| 10 if (is_posix && !is_mac) { | 10 if (is_posix && !is_mac) { |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 } | 46 } |
| 47 } | 47 } |
| 48 | 48 |
| 49 # This config is applied to targets that depend on libvpx. | 49 # This config is applied to targets that depend on libvpx. |
| 50 config("libvpx_external_config") { | 50 config("libvpx_external_config") { |
| 51 include_dirs = [ | 51 include_dirs = [ |
| 52 "//third_party/libvpx/source/libvpx", | 52 "//third_party/libvpx/source/libvpx", |
| 53 ] | 53 ] |
| 54 } | 54 } |
| 55 | 55 |
| 56 executable("libvpx_obj_int_extract") { | |
| 57 sources = [ | |
| 58 "//third_party/libvpx/source/libvpx/build/make/obj_int_extract.c" | |
| 59 ] | |
| 60 configs += [ ":libvpx_config" ] | |
| 61 configs -= [ "//build/config/compiler:chromium_code" ] | |
| 62 configs += [ "//build/config/compiler:no_chromium_code" ] | |
| 63 if (is_android_webview_build) { | |
| 64 defines += [ "FORCE_PARSE_ELF" ] | |
| 65 include_dirs += [ "//third_party/libvpx/include" ] | |
| 66 } | |
| 67 } | |
| 68 | |
| 69 # This works only on POSIX to extract integer values from an object file. | |
| 70 template("obj_int_extract") { | |
| 71 action(target_name) { | |
| 72 script = "//third_party/libvpx/obj_int_extract.py" | |
| 73 bin_label = "//third_party/libvpx($host_toolchain)" | |
| 74 | |
| 75 args = [ | |
| 76 "-e", | |
| 77 "./" + rebase_path(get_label_info(bin_label, "root_out_dir") + | |
| 78 "/libvpx_obj_int_extract", | |
| 79 root_build_dir) | |
| 80 ] | |
| 81 | |
| 82 if (cpu_arch == "arm") { | |
| 83 args += [ "-f", "gas" ] | |
| 84 } else { | |
| 85 args += [ "-f", "rvds" ] | |
| 86 } | |
| 87 | |
| 88 if (is_win) { | |
| 89 obj_extension = "obj" | |
| 90 } else { | |
| 91 obj_extension = "o" | |
| 92 } | |
| 93 | |
| 94 args += [ | |
| 95 "-b", | |
| 96 rebase_path(get_label_info(":libvpx_asm_offsets", "target_out_dir")) + | |
| 97 "/" + invoker.src_dir + "/libvpx_asm_offsets." + | |
| 98 invoker.obj_file_root + ".${obj_extension}" | |
| 99 ] | |
| 100 out_file = "$target_gen_dir/" + invoker.obj_file_root + ".asm" | |
| 101 args += [ "-o", rebase_path(out_file) ] | |
| 102 outputs = [ out_file ] | |
| 103 deps = [ | |
| 104 ":libvpx_asm_offsets", | |
| 105 ":libvpx_obj_int_extract($host_toolchain)" | |
| 106 ] | |
| 107 } | |
| 108 } | |
| 109 | |
| 110 if (cpu_arch == "x86" || cpu_arch == "x64") { | 56 if (cpu_arch == "x86" || cpu_arch == "x64") { |
| 111 yasm_assemble("libvpx_yasm") { | 57 yasm_assemble("libvpx_yasm") { |
| 112 if (cpu_arch == "x86") { | 58 if (cpu_arch == "x86") { |
| 113 sources = libvpx_srcs_x86_assembly | 59 sources = libvpx_srcs_x86_assembly |
| 114 } else if (cpu_arch == "x64") { | 60 } else if (cpu_arch == "x64") { |
| 115 sources = libvpx_srcs_x86_64_assembly | 61 sources = libvpx_srcs_x86_64_assembly |
| 116 } | 62 } |
| 117 | 63 |
| 118 defines = [ "CHROMIUM" ] | 64 defines = [ "CHROMIUM" ] |
| 119 include_dirs = [ | 65 include_dirs = [ |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 } | 227 } |
| 282 if (is_android) { | 228 if (is_android) { |
| 283 deps += [ "//third_party/android_tools:cpu_features" ] | 229 deps += [ "//third_party/android_tools:cpu_features" ] |
| 284 } | 230 } |
| 285 if (cpu_arch == "arm") { | 231 if (cpu_arch == "arm") { |
| 286 deps += [ ":libvpx_assembly_arm" ] | 232 deps += [ ":libvpx_assembly_arm" ] |
| 287 } | 233 } |
| 288 | 234 |
| 289 public_configs = [ ":libvpx_external_config" ] | 235 public_configs = [ ":libvpx_external_config" ] |
| 290 } | 236 } |
| OLD | NEW |