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 23 matching lines...) Expand all Loading... |
34 cpu_arch_full = cpu_arch | 34 cpu_arch_full = cpu_arch |
35 } | 35 } |
36 | 36 |
37 config("libvpx_config") { | 37 config("libvpx_config") { |
38 include_dirs = [ | 38 include_dirs = [ |
39 "//third_party/libvpx/source/config", | 39 "//third_party/libvpx/source/config", |
40 "//third_party/libvpx/source/config/$os_category/$cpu_arch_full", | 40 "//third_party/libvpx/source/config/$os_category/$cpu_arch_full", |
41 "//third_party/libvpx/source/libvpx", | 41 "//third_party/libvpx/source/libvpx", |
42 "$root_gen_dir/third_party/libvpx", # Provides vpx_rtcd.h. | 42 "$root_gen_dir/third_party/libvpx", # Provides vpx_rtcd.h. |
43 ] | 43 ] |
44 cflags = [ "-Wno-unused-function", "-Wno-sign-compare" ] | 44 if (!is_win) { |
| 45 cflags = [ "-Wno-unused-function", "-Wno-sign-compare" ] |
| 46 } |
45 } | 47 } |
46 | 48 |
47 # This config is applied to targets that depend on libvpx. | 49 # This config is applied to targets that depend on libvpx. |
48 config("libvpx_external_config") { | 50 config("libvpx_external_config") { |
49 include_dirs = [ | 51 include_dirs = [ |
50 "//third_party/libvpx/source/libvpx", | 52 "//third_party/libvpx/source/libvpx", |
51 ] | 53 ] |
52 } | 54 } |
53 | 55 |
54 executable("libvpx_obj_int_extract") { | 56 executable("libvpx_obj_int_extract") { |
55 sources = [ | 57 sources = [ |
56 "//third_party/libvpx/source/libvpx/build/make/obj_int_extract.c" | 58 "//third_party/libvpx/source/libvpx/build/make/obj_int_extract.c" |
57 ] | 59 ] |
58 configs += [ ":libvpx_config" ] | 60 configs += [ ":libvpx_config" ] |
| 61 configs -= [ "//build/config/compiler:chromium_code" ] |
| 62 configs += [ "//build/config/compiler:no_chromium_code" ] |
59 if (is_android_webview_build) { | 63 if (is_android_webview_build) { |
60 defines += [ "FORCE_PARSE_ELF" ] | 64 defines += [ "FORCE_PARSE_ELF" ] |
61 include_dirs += [ "//third_party/libvpx/include" ] | 65 include_dirs += [ "//third_party/libvpx/include" ] |
62 } | 66 } |
63 } | 67 } |
64 | 68 |
65 # A library whose object files contain integers to be extracted. | 69 # A library whose object files contain integers to be extracted. |
66 static_library("libvpx_asm_offsets") { | 70 static_library("libvpx_asm_offsets") { |
67 sources = [ | 71 sources = [ |
68 "//third_party/libvpx/source/libvpx/vp8/encoder/vp8_asm_enc_offsets.c", | 72 "//third_party/libvpx/source/libvpx/vp8/encoder/vp8_asm_enc_offsets.c", |
69 "//third_party/libvpx/source/libvpx/vpx_scale/vpx_scale_asm_offsets.c" | 73 "//third_party/libvpx/source/libvpx/vpx_scale/vpx_scale_asm_offsets.c" |
70 ] | 74 ] |
71 configs += [ ":libvpx_config" ] | 75 configs += [ ":libvpx_config" ] |
| 76 configs -= [ "//build/config/compiler:chromium_code" ] |
| 77 configs += [ "//build/config/compiler:no_chromium_code" ] |
72 if (is_clang) { | 78 if (is_clang) { |
73 cflags = [ "-Wno-unused-function" ] | 79 cflags = [ "-Wno-unused-function" ] |
74 } | 80 } |
75 } | 81 } |
76 | 82 |
77 # This works only on POSIX to extract integer values from an object file. | 83 # This works only on POSIX to extract integer values from an object file. |
78 template("obj_int_extract") { | 84 template("obj_int_extract") { |
79 action(target_name) { | 85 action(target_name) { |
80 script = "//third_party/libvpx/obj_int_extract.py" | 86 script = "//third_party/libvpx/obj_int_extract.py" |
81 bin_label = "//third_party/libvpx($host_toolchain)" | 87 bin_label = "//third_party/libvpx($host_toolchain)" |
82 | 88 |
83 args = [ | 89 args = [ |
84 "-e", | 90 "-e", |
85 "./" + rebase_path(get_label_info(bin_label, "root_out_dir") + | 91 "./" + rebase_path(get_label_info(bin_label, "root_out_dir") + |
86 "/libvpx_obj_int_extract", | 92 "/libvpx_obj_int_extract", |
87 root_build_dir) | 93 root_build_dir) |
88 ] | 94 ] |
89 | 95 |
90 if (cpu_arch == "arm") { | 96 if (cpu_arch == "arm") { |
91 args += [ "-f", "gas" ] | 97 args += [ "-f", "gas" ] |
92 } else { | 98 } else { |
93 args += [ "-f", "rvds" ] | 99 args += [ "-f", "rvds" ] |
94 } | 100 } |
95 | 101 |
| 102 if (is_win) { |
| 103 obj_extension = "obj" |
| 104 } else { |
| 105 obj_extension = "o" |
| 106 } |
| 107 |
96 args += [ | 108 args += [ |
97 "-b", | 109 "-b", |
98 rebase_path(get_label_info(":libvpx_asm_offsets", "target_out_dir")) + | 110 rebase_path(get_label_info(":libvpx_asm_offsets", "target_out_dir")) + |
99 "/" + invoker.src_dir + "/libvpx_asm_offsets." + | 111 "/" + invoker.src_dir + "/libvpx_asm_offsets." + |
100 invoker.obj_file_root + ".o" | 112 invoker.obj_file_root + ".${obj_extension}" |
101 ] | 113 ] |
102 out_file = "$target_gen_dir/" + invoker.obj_file_root + ".asm" | 114 out_file = "$target_gen_dir/" + invoker.obj_file_root + ".asm" |
103 args += [ "-o", rebase_path(out_file) ] | 115 args += [ "-o", rebase_path(out_file) ] |
104 outputs = [ out_file ] | 116 outputs = [ out_file ] |
105 deps = [ | 117 deps = [ |
106 ":libvpx_asm_offsets", | 118 ":libvpx_asm_offsets", |
107 ":libvpx_obj_int_extract($host_toolchain)" | 119 ":libvpx_obj_int_extract($host_toolchain)" |
108 ] | 120 ] |
109 } | 121 } |
110 } | 122 } |
(...skipping 25 matching lines...) Expand all Loading... |
136 ] | 148 ] |
137 deps = [ | 149 deps = [ |
138 ":gen_asm_offsets_vp8", | 150 ":gen_asm_offsets_vp8", |
139 ":gen_asm_offsets_scale", | 151 ":gen_asm_offsets_scale", |
140 ] | 152 ] |
141 } | 153 } |
142 } | 154 } |
143 | 155 |
144 static_library("libvpx_intrinsics_mmx") { | 156 static_library("libvpx_intrinsics_mmx") { |
145 configs += [ ":libvpx_config" ] | 157 configs += [ ":libvpx_config" ] |
146 cflags = [ "-mmmx" ] | 158 configs -= [ "//build/config/compiler:chromium_code" ] |
| 159 configs += [ "//build/config/compiler:no_chromium_code" ] |
| 160 if (!is_win) { |
| 161 cflags = [ "-mmmx" ] |
| 162 } |
147 if (cpu_arch == "x86") { | 163 if (cpu_arch == "x86") { |
148 sources = libvpx_srcs_x86_mmx | 164 sources = libvpx_srcs_x86_mmx |
149 } else if (cpu_arch == "x64") { | 165 } else if (cpu_arch == "x64") { |
150 sources = libvpx_srcs_x86_64_mmx | 166 sources = libvpx_srcs_x86_64_mmx |
151 } | 167 } |
152 } | 168 } |
153 | 169 |
154 static_library("libvpx_intrinsics_sse2") { | 170 static_library("libvpx_intrinsics_sse2") { |
155 configs += [ ":libvpx_config" ] | 171 configs += [ ":libvpx_config" ] |
156 cflags = [ "-msse2" ] | 172 configs -= [ "//build/config/compiler:chromium_code" ] |
| 173 configs += [ "//build/config/compiler:no_chromium_code" ] |
| 174 if (!is_win) { |
| 175 cflags = [ "-msse2" ] |
| 176 } |
157 if (cpu_arch == "x86") { | 177 if (cpu_arch == "x86") { |
158 sources = libvpx_srcs_x86_sse2 | 178 sources = libvpx_srcs_x86_sse2 |
159 } else if (cpu_arch == "x64") { | 179 } else if (cpu_arch == "x64") { |
160 sources = libvpx_srcs_x86_64_sse2 | 180 sources = libvpx_srcs_x86_64_sse2 |
161 } | 181 } |
162 } | 182 } |
163 | 183 |
164 static_library("libvpx_intrinsics_ssse3") { | 184 static_library("libvpx_intrinsics_ssse3") { |
165 configs += [ ":libvpx_config" ] | 185 configs += [ ":libvpx_config" ] |
166 cflags = [ "-mssse3" ] | 186 configs -= [ "//build/config/compiler:chromium_code" ] |
| 187 configs += [ "//build/config/compiler:no_chromium_code" ] |
| 188 if (!is_win) { |
| 189 cflags = [ "-mssse3" ] |
| 190 } |
167 if (cpu_arch == "x86") { | 191 if (cpu_arch == "x86") { |
168 sources = libvpx_srcs_x86_ssse3 | 192 sources = libvpx_srcs_x86_ssse3 |
169 } else if (cpu_arch == "x64") { | 193 } else if (cpu_arch == "x64") { |
170 sources = libvpx_srcs_x86_64_ssse3 | 194 sources = libvpx_srcs_x86_64_ssse3 |
171 } | 195 } |
172 } | 196 } |
173 | 197 |
174 static_library("libvpx_intrinsics_sse4_1") { | 198 static_library("libvpx_intrinsics_sse4_1") { |
175 configs += [ ":libvpx_config" ] | 199 configs += [ ":libvpx_config" ] |
176 cflags = [ "-msse4.1" ] | 200 configs -= [ "//build/config/compiler:chromium_code" ] |
| 201 configs += [ "//build/config/compiler:no_chromium_code" ] |
| 202 if (!is_win) { |
| 203 cflags = [ "-msse4.1" ] |
| 204 } |
177 if (cpu_arch == "x86") { | 205 if (cpu_arch == "x86") { |
178 sources = libvpx_srcs_x86_sse4_1 | 206 sources = libvpx_srcs_x86_sse4_1 |
179 } else if (cpu_arch == "x64") { | 207 } else if (cpu_arch == "x64") { |
180 sources = libvpx_srcs_x86_64_sse4_1 | 208 sources = libvpx_srcs_x86_64_sse4_1 |
181 } | 209 } |
182 } | 210 } |
183 | 211 |
184 if (cpu_arch_full == "arm-neon-cpu-detect") { | 212 if (cpu_arch_full == "arm-neon-cpu-detect") { |
185 static_library("libvpx_intrinsics_neon") { | 213 static_library("libvpx_intrinsics_neon") { |
186 configs -= [ "//build/config/compiler:compiler_arm_fpu" ] | 214 configs -= [ "//build/config/compiler:compiler_arm_fpu" ] |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 sources = libvpx_srcs_arm_neon | 276 sources = libvpx_srcs_arm_neon |
249 } else if (is_android) { | 277 } else if (is_android) { |
250 sources = libvpx_srcs_arm_neon_cpu_detect | 278 sources = libvpx_srcs_arm_neon_cpu_detect |
251 } else { | 279 } else { |
252 sources = libvpx_srcs_arm | 280 sources = libvpx_srcs_arm |
253 } | 281 } |
254 } else if (cpu_arch == "arm64") { | 282 } else if (cpu_arch == "arm64") { |
255 sources = libvpx_srcs_arm64 | 283 sources = libvpx_srcs_arm64 |
256 } | 284 } |
257 configs += [ ":libvpx_config" ] | 285 configs += [ ":libvpx_config" ] |
| 286 configs -= [ "//build/config/compiler:chromium_code" ] |
| 287 configs += [ "//build/config/compiler:no_chromium_code" ] |
258 deps = [] | 288 deps = [] |
259 if (cpu_arch == "x86" || (cpu_arch == "x64" && !is_msan)) { | 289 if (cpu_arch == "x86" || (cpu_arch == "x64" && !is_msan)) { |
260 deps += [ | 290 deps += [ |
261 ":libvpx_yasm", | 291 ":libvpx_yasm", |
262 ":libvpx_intrinsics_mmx", | 292 ":libvpx_intrinsics_mmx", |
263 ":libvpx_intrinsics_sse2", | 293 ":libvpx_intrinsics_sse2", |
264 ":libvpx_intrinsics_ssse3", | 294 ":libvpx_intrinsics_ssse3", |
265 ":libvpx_intrinsics_sse4_1", | 295 ":libvpx_intrinsics_sse4_1", |
266 ] | 296 ] |
267 } | 297 } |
268 if (cpu_arch_full == "arm-neon-cpu-detect") { | 298 if (cpu_arch_full == "arm-neon-cpu-detect") { |
269 deps += [ ":libvpx_intrinsics_neon" ] | 299 deps += [ ":libvpx_intrinsics_neon" ] |
270 } | 300 } |
271 if (is_android) { | 301 if (is_android) { |
272 deps += [ "//third_party/android_tools:cpu_features" ] | 302 deps += [ "//third_party/android_tools:cpu_features" ] |
273 } | 303 } |
274 if (cpu_arch == "arm") { | 304 if (cpu_arch == "arm") { |
275 deps += [ ":libvpx_assembly_arm" ] | 305 deps += [ ":libvpx_assembly_arm" ] |
276 } | 306 } |
277 | 307 |
278 public_configs = [ ":libvpx_external_config" ] | 308 public_configs = [ ":libvpx_external_config" ] |
279 } | 309 } |
OLD | NEW |