blob: 4f8cb2b8d03f3d9d6cc57d7d2f65f8f6df38f1c7 [file] [log] [blame]
scottmg@chromium.org1c7e15c2012-01-31 19:56:52 +00001# Copyright (c) 2012 The Chromium Authors. All rights reserved.
fbarchard@chromium.orgb82dd682010-11-03 17:34:40 +00002# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
fbarchard@chromium.orgb82dd682010-11-03 17:34:40 +00004{
hclam@chromium.org266f7962011-06-06 21:37:45 +00005 'variables': {
ajm@chromium.org35f1d812013-03-07 19:11:51 +00006 'libvpx_build_vp9%': 1,
grunell@chromium.org36231c02013-01-11 08:06:48 +00007 'libvpx_source%': 'source/libvpx',
thakis@chromium.org982d1472014-08-29 15:23:06 +00008 # Disable LTO for neon targets
9 # crbug.com/408997
10 'use_lto%': 0,
phajdan.jr@chromium.orga2f53662013-05-02 22:02:06 +000011 'conditions': [
12 ['os_posix==1', {
13 'asm_obj_extension': 'o',
14 }],
15 ['OS=="win"', {
16 'asm_obj_extension': 'obj',
17 }],
18
earthdok@chromium.org67a84162014-03-27 19:05:43 +000019 ['msan==1', {
20 'target_arch_full': 'generic',
phajdan.jr@chromium.orga2f53662013-05-02 22:02:06 +000021 }, {
22 'conditions': [
fgalligan@chromium.org0f521b02014-06-19 20:41:10 +000023 ['(target_arch=="arm" or target_arch=="armv7") and arm_neon==1', {
24 'target_arch_full': 'arm-neon',
phajdan.jr@chromium.orga2f53662013-05-02 22:02:06 +000025 }, {
earthdok@chromium.org67a84162014-03-27 19:05:43 +000026 'conditions': [
fgalligan@chromium.org0f521b02014-06-19 20:41:10 +000027 ['OS=="android" and ((target_arch=="arm" or target_arch=="armv7") and arm_neon==0)', {
28 'target_arch_full': 'arm-neon-cpu-detect',
earthdok@chromium.org67a84162014-03-27 19:05:43 +000029 }, {
fgalligan@chromium.org0f521b02014-06-19 20:41:10 +000030 'target_arch_full': '<(target_arch)',
earthdok@chromium.org67a84162014-03-27 19:05:43 +000031 }],
32 ],
phajdan.jr@chromium.orga2f53662013-05-02 22:02:06 +000033 }],
tomfinegan@chromium.orgef98d992014-04-09 17:43:48 +000034 ['target_arch=="arm64"', {
johannkoenig@chromium.org7765c072014-05-16 15:51:21 +000035 'target_arch_full': 'arm64',
primiano@chromium.orgc8e01e32014-04-01 08:46:31 +000036 }],
phajdan.jr@chromium.orga2f53662013-05-02 22:02:06 +000037 ],
38 }],
39
40 ['os_posix == 1 and OS != "mac"', {
41 'OS_CATEGORY%': 'linux',
42 }, {
43 'OS_CATEGORY%': '<(OS)',
44 }],
45 ],
46
47 # Location of the intermediate output.
48 'shared_generated_dir': '<(SHARED_INTERMEDIATE_DIR)/third_party/libvpx',
hclam@chromium.org266f7962011-06-06 21:37:45 +000049 },
ajm@chromium.org35f1d812013-03-07 19:11:51 +000050 'target_defaults': {
51 'target_conditions': [
52 ['<(libvpx_build_vp9)==0', {
53 'sources/': [ ['exclude', '(^|/)vp9/'], ],
54 }],
55 ],
sebmarchand@chromium.orgadc66e22014-03-17 21:48:53 +000056 'variables': {
57 'conditions': [
58 ['OS=="win" and buildtype=="Official"', {
michaelbai@chromium.org1bb0ad02014-05-16 21:08:48 +000059 # Do not set to 'size', as it results in an error on win64.
fgalligan@chromium.org55bd50b2014-05-04 21:10:14 +000060 'optimize' :'speed',
sebmarchand@chromium.orgadc66e22014-03-17 21:48:53 +000061 }],
62 ],
63 },
ajm@chromium.org35f1d812013-03-07 19:11:51 +000064 },
fischman@chromium.orgc91d5642011-02-24 18:17:21 +000065 'conditions': [
phajdan.jr@chromium.orga2f53662013-05-02 22:02:06 +000066 ['target_arch=="ia32"', {
67 'includes': ['libvpx_srcs_x86_intrinsics.gypi', ],
68 }],
earthdok@chromium.org67a84162014-03-27 19:05:43 +000069 ['target_arch=="x64" and msan==0', {
phajdan.jr@chromium.orga2f53662013-05-02 22:02:06 +000070 'includes': ['libvpx_srcs_x86_64_intrinsics.gypi', ],
71 }],
johannkoenig@chromium.org46e73702014-01-29 05:35:19 +000072 [ '(target_arch=="arm" or target_arch=="armv7") and arm_neon==0 and OS=="android"', {
73 # When building for targets which may not have NEON (but may!), include
74 # support for neon and hide it behind Android cpu-features.
75 'includes': ['libvpx_srcs_arm_neon_cpu_detect_intrinsics.gypi', ],
76 }],
johannkoenig@chromium.org796a08a2014-09-04 17:34:57 +000077 [ '(target_arch != "arm" and target_arch != "armv7") and \
78 (target_arch != "mipsel" and target_arch != "mips64el")', {
phajdan.jr@chromium.orge7504d12012-10-19 16:10:50 +000079 'targets': [
80 {
phajdan.jr@chromium.orga2f53662013-05-02 22:02:06 +000081 # This libvpx target contains both encoder and decoder.
82 # Encoder is configured to be realtime only.
phajdan.jr@chromium.orge7504d12012-10-19 16:10:50 +000083 'target_name': 'libvpx',
phajdan.jr@chromium.orga2f53662013-05-02 22:02:06 +000084 'type': 'static_library',
85 'variables': {
86 'yasm_output_path': '<(SHARED_INTERMEDIATE_DIR)/third_party/libvpx',
87 'OS_CATEGORY%': '<(OS_CATEGORY)',
88 'yasm_flags': [
89 '-D', 'CHROMIUM',
johannkoenig@chromium.orga87d9e62014-01-29 06:17:23 +000090 '-I', 'source/config/<(OS_CATEGORY)/<(target_arch_full)',
phajdan.jr@chromium.orga2f53662013-05-02 22:02:06 +000091 '-I', 'source/config',
92 '-I', '<(libvpx_source)',
93 '-I', '<(shared_generated_dir)', # Generated assembly offsets
phajdan.jr@chromium.orge7504d12012-10-19 16:10:50 +000094 ],
johannkoenig@chromium.org9f8828b2014-06-25 04:49:59 +000095 # yasm only gets the flags we define. It doesn't inherit any of the
96 # really useful defines that come with a gcc invocation. In this
97 # case, we rely on __ANDROID__ to set 'rand' to 'lrand48'.
98 # Previously we used the builtin _rand but that's gone away.
99 'conditions': [
100 ['OS=="android"', {
101 'yasm_flags': [
102 '-D', '__ANDROID__',
103 ],
104 }],
105 ],
thakis@chromium.org7b824662014-08-01 23:59:31 +0000106 'clang_warning_flags': [
107 # libvpx heavily relies on implicit enum casting.
108 '-Wno-conversion',
109 # libvpx does `if ((a == b))` in some places.
110 '-Wno-parentheses-equality',
111 ],
phajdan.jr@chromium.orgdf9edc82013-01-04 22:04:52 +0000112 },
phajdan.jr@chromium.orga2f53662013-05-02 22:02:06 +0000113 'dependencies': [
114 'gen_asm_offsets_vp8',
115 ],
116 'includes': [
117 '../yasm/yasm_compile.gypi'
118 ],
119 'include_dirs': [
johannkoenig@chromium.orga87d9e62014-01-29 06:17:23 +0000120 'source/config/<(OS_CATEGORY)/<(target_arch_full)',
phajdan.jr@chromium.orga2f53662013-05-02 22:02:06 +0000121 'source/config',
122 '<(libvpx_source)',
123 '<(libvpx_source)/vp8/common',
124 '<(libvpx_source)/vp8/decoder',
125 '<(libvpx_source)/vp8/encoder',
126 '<(shared_generated_dir)', # Provides vpx_rtcd.h.
127 ],
128 'direct_dependent_settings': {
129 'include_dirs': [
130 '<(libvpx_source)',
hclam@chromium.org29e01402012-05-30 20:41:48 +0000131 ],
132 },
phajdan.jr@chromium.orga2f53662013-05-02 22:02:06 +0000133 # VS2010 does not correctly incrementally link obj files generated
134 # from asm files. This flag disables UseLibraryDependencyInputs to
135 # avoid this problem.
136 'msvs_2010_disable_uldi_when_referenced': 1,
137 'conditions': [
138 ['target_arch=="ia32"', {
139 'includes': [
140 'libvpx_srcs_x86.gypi',
141 ],
142 'dependencies': [
143 'libvpx_intrinsics_mmx',
144 'libvpx_intrinsics_sse2',
145 # Currently no sse3 intrinsic functions
146 #'libvpx_intrinsics_sse3',
147 'libvpx_intrinsics_ssse3',
fgalligan@chromium.org360bf142014-06-20 21:27:29 +0000148 'libvpx_intrinsics_sse4_1',
johannkoenig@chromium.orgd851b912013-12-16 19:49:40 +0000149 # Currently no avx intrinsic functions
150 #'libvpx_intrinsics_avx',
johannkoenig@chromium.orgd1432732014-04-16 20:40:56 +0000151 #'libvpx_intrinsics_avx2',
phajdan.jr@chromium.orga2f53662013-05-02 22:02:06 +0000152 ],
153 }],
primiano@chromium.orgd9ef0ae2014-04-03 17:24:21 +0000154 ['target_arch=="arm64"', {
johannkoenig@chromium.org7765c072014-05-16 15:51:21 +0000155 'includes': [ 'libvpx_srcs_arm64.gypi', ],
primiano@chromium.orgd9ef0ae2014-04-03 17:24:21 +0000156 }],
phajdan.jr@chromium.orga2f53662013-05-02 22:02:06 +0000157 ['target_arch=="x64"', {
earthdok@chromium.org67a84162014-03-27 19:05:43 +0000158 'conditions': [
159 ['msan==1', {
160 'includes': [ 'libvpx_srcs_generic.gypi', ],
161 }, {
162 'includes': [
163 'libvpx_srcs_x86_64.gypi',
earthdok@chromium.org67a84162014-03-27 19:05:43 +0000164 ],
165 'dependencies': [
166 'libvpx_intrinsics_mmx',
167 'libvpx_intrinsics_sse2',
168 # Currently no sse3 intrinsic functions
169 #'libvpx_intrinsics_sse3',
170 'libvpx_intrinsics_ssse3',
fgalligan@chromium.org360bf142014-06-20 21:27:29 +0000171 'libvpx_intrinsics_sse4_1',
earthdok@chromium.org67a84162014-03-27 19:05:43 +0000172 # Currently no avx intrinsic functions
173 #'libvpx_intrinsics_avx',
johannkoenig@chromium.orgd1432732014-04-16 20:40:56 +0000174 #'libvpx_intrinsics_avx2',
earthdok@chromium.org67a84162014-03-27 19:05:43 +0000175 ],
176 }],
phajdan.jr@chromium.orga2f53662013-05-02 22:02:06 +0000177 ],
178 }],
phajdan.jr@chromium.orga2f53662013-05-02 22:02:06 +0000179 ],
180 },
181 ],
182 },
183 ],
johannkoenig@chromium.org796a08a2014-09-04 17:34:57 +0000184 # 'libvpx' target for mipsel and mips64el builds.
185 [ 'target_arch=="mipsel" or target_arch=="mips64el"', {
phajdan.jr@chromium.orga2f53662013-05-02 22:02:06 +0000186 'targets': [
187 {
188 # This libvpx target contains both encoder and decoder.
189 # Encoder is configured to be realtime only.
190 'target_name': 'libvpx',
191 'type': 'static_library',
192 'variables': {
193 'shared_generated_dir':
194 '<(SHARED_INTERMEDIATE_DIR)/third_party/libvpx',
195 },
phajdan.jr@chromium.orgdf9edc82013-01-04 22:04:52 +0000196 'includes': [
phajdan.jr@chromium.orga2f53662013-05-02 22:02:06 +0000197 'libvpx_srcs_mips.gypi',
phajdan.jr@chromium.orgdf9edc82013-01-04 22:04:52 +0000198 ],
phajdan.jr@chromium.orga2f53662013-05-02 22:02:06 +0000199 'include_dirs': [
johannkoenig@chromium.orga87d9e62014-01-29 06:17:23 +0000200 'source/config/<(OS_CATEGORY)/<(target_arch_full)',
phajdan.jr@chromium.orga2f53662013-05-02 22:02:06 +0000201 'source/config',
202 '<(libvpx_source)',
203 '<(libvpx_source)/vp8/common',
204 '<(libvpx_source)/vp8/decoder',
205 '<(libvpx_source)/vp8/encoder',
206 ],
207 'direct_dependent_settings': {
208 'include_dirs': [
209 '<(libvpx_source)',
phajdan.jr@chromium.orge7504d12012-10-19 16:10:50 +0000210 ],
211 },
phajdan.jr@chromium.orga2f53662013-05-02 22:02:06 +0000212 'sources': [
johannkoenig@chromium.orga87d9e62014-01-29 06:17:23 +0000213 'source/config/<(OS_CATEGORY)/<(target_arch_full)/vpx_config.c',
phajdan.jr@chromium.orga2f53662013-05-02 22:02:06 +0000214 ],
215 },
216 ],
217 },
218 ],
219 # 'libvpx' target for ARM builds.
fischman@chromium.orgeb258ed2013-07-18 17:30:15 +0000220 [ '(target_arch=="arm" or target_arch=="armv7") ', {
phajdan.jr@chromium.orga2f53662013-05-02 22:02:06 +0000221 'targets': [
222 {
223 # This libvpx target contains both encoder and decoder.
224 # Encoder is configured to be realtime only.
225 'target_name': 'libvpx',
226 'type': 'static_library',
fgalligan@chromium.org0f521b02014-06-19 20:41:10 +0000227 'dependencies': [
228 'gen_asm_offsets_vp8',
229 'gen_asm_offsets_vpx_scale',
230 ],
phajdan.jr@chromium.orga2f53662013-05-02 22:02:06 +0000231
232 # Copy the script to the output folder so that we can use it with
233 # absolute path.
234 'copies': [{
235 'destination': '<(shared_generated_dir)',
236 'files': [
237 '<(ads2gas_script_path)',
fgalligan@chromium.orgf7b25ae2013-06-13 15:32:29 +0000238 '<(ads2gas_script_include)',
phajdan.jr@chromium.orga2f53662013-05-02 22:02:06 +0000239 ],
240 }],
241
242 # Rule to convert .asm files to .S files.
243 'rules': [
244 {
245 'rule_name': 'convert_asm',
246 'extension': 'asm',
fgalligan@chromium.org93177282013-06-12 21:33:25 +0000247 'inputs': [
248 '<(shared_generated_dir)/<(ads2gas_script)',
249 '<(shared_generated_dir)/thumb.pm',
250 ],
phajdan.jr@chromium.orga2f53662013-05-02 22:02:06 +0000251 'outputs': [
252 '<(shared_generated_dir)/<(RULE_INPUT_ROOT).S',
253 ],
254 'action': [
255 'bash',
256 '-c',
johannkoenig@chromium.orgd851b912013-12-16 19:49:40 +0000257 'cat <(RULE_INPUT_PATH) | perl <(shared_generated_dir)/<(ads2gas_script) -chromium > <(shared_generated_dir)/<(RULE_INPUT_ROOT).S',
phajdan.jr@chromium.orga2f53662013-05-02 22:02:06 +0000258 ],
259 'process_outputs_as_sources': 1,
thakis@chromium.orgd0998662014-01-09 05:56:19 +0000260 'message': 'Convert libvpx asm file for ARM <(RULE_INPUT_PATH)',
phajdan.jr@chromium.orga2f53662013-05-02 22:02:06 +0000261 },
262 ],
263
264 'variables': {
fischman@chromium.orgeb258ed2013-07-18 17:30:15 +0000265 'variables': {
266 'conditions': [
267 ['OS=="ios"', {
268 'ads2gas_script%': 'ads2gas_apple.pl',
269 }, {
270 'ads2gas_script%': 'ads2gas.pl',
271 }],
272 ],
273 },
274 'ads2gas_script%': '<(ads2gas_script)',
phajdan.jr@chromium.orga2f53662013-05-02 22:02:06 +0000275 # Location of the assembly conversion script.
phajdan.jr@chromium.orga2f53662013-05-02 22:02:06 +0000276 'ads2gas_script_path': '<(libvpx_source)/build/make/<(ads2gas_script)',
fgalligan@chromium.orgf7b25ae2013-06-13 15:32:29 +0000277 'ads2gas_script_include': '<(libvpx_source)/build/make/thumb.pm',
phajdan.jr@chromium.orga2f53662013-05-02 22:02:06 +0000278 },
fischman@chromium.orgeb258ed2013-07-18 17:30:15 +0000279 'xcode_settings': {
280 'OTHER_CFLAGS': [
fischman@chromium.org08a02be2013-09-21 03:56:52 +0000281 '-I<!(pwd)/source/config/<(OS_CATEGORY)/<(target_arch_full)',
282 '-I<!(pwd)/source/config',
283 '-I<(shared_generated_dir)',
fischman@chromium.orgeb258ed2013-07-18 17:30:15 +0000284 ],
285 },
phajdan.jr@chromium.orga2f53662013-05-02 22:02:06 +0000286 'include_dirs': [
287 'source/config/<(OS_CATEGORY)/<(target_arch_full)',
288 'source/config',
289 '<(libvpx_source)',
290 ],
291 'direct_dependent_settings': {
292 'include_dirs': [
293 '<(libvpx_source)',
294 ],
295 },
michaelbai@chromium.org1bb0ad02014-05-16 21:08:48 +0000296 # We need to explicitly tell the assembler to look for
297 # .include directive files from the place where they're
298 # generated to.
299 'cflags': [
300 '-Wa,-I,<(shared_generated_dir)',
301 ],
phajdan.jr@chromium.orga2f53662013-05-02 22:02:06 +0000302 'conditions': [
michaelbai@chromium.org1bb0ad02014-05-16 21:08:48 +0000303 # For Android WebView, the following pathc are not required and not
304 # allowed, because they generate the absolute path.
305 ['android_webview_build!=1', {
306 'cflags': [
307 '-Wa,-I,<!(pwd)/source/config/<(OS_CATEGORY)/<(target_arch_full)',
308 '-Wa,-I,<!(pwd)/source/config',
309 ],
310 }],
phajdan.jr@chromium.orga2f53662013-05-02 22:02:06 +0000311 # Libvpx optimizations for ARMv6 or ARMv7 without NEON.
312 ['arm_neon==0', {
313 'conditions': [
314 ['OS=="android"', {
fgalligan@chromium.org0f521b02014-06-19 20:41:10 +0000315 'includes': [
316 'libvpx_srcs_arm_neon_cpu_detect.gypi',
phajdan.jr@chromium.orga2f53662013-05-02 22:02:06 +0000317 ],
johannkoenig@chromium.org46e73702014-01-29 05:35:19 +0000318 'dependencies': [
319 'libvpx_intrinsics_neon',
320 ],
phajdan.jr@chromium.orga2f53662013-05-02 22:02:06 +0000321 'cflags': [
322 '-Wa,-mfpu=neon',
323 ],
324 }, {
325 'includes': [
326 'libvpx_srcs_arm.gypi',
327 ],
328 }],
329 ],
330 }],
331 # Libvpx optimizations for ARMv7 with NEON.
332 ['arm_neon==1', {
333 'includes': [
334 'libvpx_srcs_arm_neon.gypi',
335 ],
336 }],
337 ['OS == "android"', {
michaelbai@google.com07718752014-01-15 19:12:47 +0000338 'includes': [
339 '../../build/android/cpufeatures.gypi',
phajdan.jr@chromium.orga2f53662013-05-02 22:02:06 +0000340 ],
341 }],
fischman@chromium.orgedf59152014-03-20 22:54:28 +0000342 ['OS == "ios"', {
343 'xcode_settings': {
344 'OTHER_CFLAGS!': [
345 # Breaks at least boolhuff_armv5te:token_high_bit_not_set_ev.
346 '-fstack-protector-all', # Implies -fstack-protector
347 ],
348 },
349 }],
phajdan.jr@chromium.orga2f53662013-05-02 22:02:06 +0000350 ],
hclam@chromium.org29e01402012-05-30 20:41:48 +0000351 },
352 ],
phajdan.jr@chromium.orge7504d12012-10-19 16:10:50 +0000353 }],
hclam@chromium.org71275552011-08-11 12:51:38 +0000354 ],
phajdan.jr@chromium.orga2f53662013-05-02 22:02:06 +0000355 'targets': [
356 {
fischman@chromium.orgeb258ed2013-07-18 17:30:15 +0000357 # A tool that runs on host to extract integers from object file.
phajdan.jr@chromium.orga2f53662013-05-02 22:02:06 +0000358 'target_name': 'libvpx_obj_int_extract',
359 'type': 'executable',
360 'toolsets': ['host'],
361 'include_dirs': [
362 'source/config/<(OS_CATEGORY)/<(target_arch_full)',
363 'source/config',
364 '<(libvpx_source)',
365 ],
366 'sources': [
367 '<(libvpx_source)/build/make/obj_int_extract.c',
michaelbai@chromium.org543e09b2014-03-28 20:56:24 +0000368 ],
369 'conditions': [
370 ['android_webview_build==1', {
371 'defines': [ 'FORCE_PARSE_ELF' ],
372 'include_dirs': [ 'include' ],
373 }],
374 ],
phajdan.jr@chromium.orga2f53662013-05-02 22:02:06 +0000375 },
376 {
377 # A library that contains assembly offsets needed.
378 'target_name': 'libvpx_asm_offsets_vp8',
379 'type': 'static_library',
michaelbai@google.com19002df2013-12-12 00:03:37 +0000380 'android_unmangled_name': 1,
phajdan.jr@chromium.orga2f53662013-05-02 22:02:06 +0000381 'hard_dependency': 1,
382 'include_dirs': [
383 'source/config/<(OS_CATEGORY)/<(target_arch_full)',
384 'source/config',
385 '<(libvpx_source)',
386 ],
387 'conditions': [
388 ['asan==1', {
389 'cflags!': [ '-fsanitize=address' ],
390 'xcode_settings': { 'OTHER_CFLAGS!': [ '-fsanitize=address' ] },
391 'ldflags!': [ '-fsanitize=address' ],
392 }],
hans@chromium.orgc0e7b202014-03-25 20:50:23 +0000393 ['OS=="win"', {
394 'msvs_settings': {
395 'VCCLCompilerTool': {
396 # Clang uses -fdata-sections when function level linking is
397 # enabled, but libvpx_obj_int_extract expects all data to
398 # reside in the same section on Windows.
399 'EnableFunctionLevelLinking': 'false',
400 },
401 },
402 }],
phajdan.jr@chromium.orga2f53662013-05-02 22:02:06 +0000403 ],
404 'sources': [
405 '<(libvpx_source)/vp8/encoder/vp8_asm_enc_offsets.c',
406 ],
407 },
408 {
409 # A library that contains assembly offsets needed.
410 # TODO(fgalligan): Merge libvpx_asm_offsets_vpx_scale into
411 # libvpx_asm_offsets.
412 'target_name': 'libvpx_asm_offsets_vpx_scale',
413 'type': 'static_library',
michaelbai@google.com19002df2013-12-12 00:03:37 +0000414 'android_unmangled_name': 1,
phajdan.jr@chromium.orga2f53662013-05-02 22:02:06 +0000415 'hard_dependency': 1,
416 'include_dirs': [
417 'source/config/<(OS_CATEGORY)/<(target_arch_full)',
418 'source/config',
419 '<(libvpx_source)',
420 ],
421 'conditions': [
422 ['asan==1', {
423 'cflags!': [ '-faddress-sanitizer', '-fsanitize=address', ],
424 'xcode_settings': {
425 'OTHER_CFLAGS!': [ '-faddress-sanitizer','-fsanitize=address' ],
426 },
427 'ldflags!': [ '-faddress-sanitizer', '-fsanitize=address', ],
428 }],
429 ],
430 'sources': [
431 '<(libvpx_source)/vpx_scale/vpx_scale_asm_offsets.c',
432 ],
433 },
434 {
435 # A target that takes assembly offsets library and generate the
436 # corresponding assembly files.
437 # This target is a hard dependency because the generated .asm files
438 # are needed all assembly optimized files in libvpx.
439 'target_name': 'gen_asm_offsets_vp8',
440 'type': 'none',
441 'hard_dependency': 1,
442 'dependencies': [
443 'libvpx_asm_offsets_vp8',
444 'libvpx_obj_int_extract#host',
445 ],
michaelbai@google.com07718752014-01-15 19:12:47 +0000446 'variables' : {
fgalligan@chromium.org0f521b02014-06-19 20:41:10 +0000447 'lib_intermediate_name' : '',
michaelbai@google.com1d4fbbb2014-01-28 00:13:42 +0000448 'output_format':'',
449 'output_dir': '<(shared_generated_dir)',
michaelbai@google.com07718752014-01-15 19:12:47 +0000450 'conditions' : [
451 ['android_webview_build==1', {
michaelbai@chromium.org177bcf52014-04-03 23:37:53 +0000452 # pass the empty string for 3rd and 4th arguments of
453 # intermediates-dir-for macro.
fgalligan@chromium.org0f521b02014-06-19 20:41:10 +0000454 'lib_intermediate_name' : '$(abspath $(call intermediates-dir-for,STATIC_LIBRARIES,libvpx_asm_offsets_vp8,,,$(gyp_var_prefix)))/libvpx_asm_offsets_vp8.a',
fgalligan@chromium.org18772f22014-05-28 15:46:10 +0000455 }],
michaelbai@google.com1d4fbbb2014-01-28 00:13:42 +0000456 ['(target_arch=="arm" or target_arch=="armv7")', {
457 'output_format': 'gas',
458 }, {
459 'output_format': 'rvds',
michaelbai@google.com07718752014-01-15 19:12:47 +0000460 }],
461 ],
462 },
phajdan.jr@chromium.orga2f53662013-05-02 22:02:06 +0000463 'conditions': [
464 ['OS=="win"', {
465 'variables': {
466 'ninja_obj_dir': '<(PRODUCT_DIR)/obj/third_party/libvpx/<(libvpx_source)/vp8',
467 },
468 'actions': [
469 {
470 'action_name': 'copy_enc_offsets_obj',
fgalligan@chromium.org0f521b02014-06-19 20:41:10 +0000471 'inputs': [ 'copy_obj.py' ],
phajdan.jr@chromium.orga2f53662013-05-02 22:02:06 +0000472 'outputs': [ '<(INTERMEDIATE_DIR)/vp8_asm_enc_offsets.obj' ],
473 'action': [
dpranke@chromium.orgc9115182014-01-25 03:18:12 +0000474 'python',
475 '<(DEPTH)/third_party/libvpx/copy_obj.py',
phajdan.jr@chromium.orga2f53662013-05-02 22:02:06 +0000476 '-d', '<@(_outputs)',
fgalligan@chromium.org0f521b02014-06-19 20:41:10 +0000477 '-s', '<(PRODUCT_DIR)/obj/libvpx_asm_offsets_vp8/vp8_asm_enc_offsets.obj',
phajdan.jr@chromium.orga2f53662013-05-02 22:02:06 +0000478 '-s', '<(ninja_obj_dir)/encoder/libvpx_asm_offsets_vp8.vp8_asm_enc_offsets.obj',
fgalligan@chromium.org0f521b02014-06-19 20:41:10 +0000479 '-s', '<(PRODUCT_DIR)/obj/Source/WebKit/chromium/third_party/libvpx/<(libvpx_source)/vp8/encoder/libvpx_asm_offsets_vp8.vp8_asm_enc_offsets.obj',
phajdan.jr@chromium.orga2f53662013-05-02 22:02:06 +0000480 ],
tomfinegan@google.com962354e2014-08-13 18:34:31 +0000481 'process_outputs_as_sources': 1,
phajdan.jr@chromium.orga2f53662013-05-02 22:02:06 +0000482 },
483 ],
tomfinegan@chromium.org76b899c2014-08-15 06:02:52 +0000484 'sources': [
485 '<(INTERMEDIATE_DIR)/vp8_asm_enc_offsets.obj',
486 ],
phajdan.jr@chromium.orga2f53662013-05-02 22:02:06 +0000487 }, {
michaelbai@google.com1d4fbbb2014-01-28 00:13:42 +0000488 'variables': {
489 'unpack_lib_search_path_list': [
fgalligan@chromium.org0f521b02014-06-19 20:41:10 +0000490 '-a', '<(PRODUCT_DIR)/libvpx_asm_offsets_vp8.a',
491 '-a', '<(LIB_DIR)/third_party/libvpx/libvpx_asm_offsets_vp8.a',
kjellander@chromium.orgb80efbc2014-08-11 16:24:14 +0000492 '-a', '<(LIB_DIR)/chromium/src/third_party/libvpx/libvpx_asm_offsets_vp8.a',
fgalligan@chromium.org0f521b02014-06-19 20:41:10 +0000493 '-a', '<(LIB_DIR)/Source/WebKit/chromium/third_party/libvpx/libvpx_asm_offsets_vp8.a',
494 '-a', '<(lib_intermediate_name)',
michaelbai@google.com1d4fbbb2014-01-28 00:13:42 +0000495 ],
fgalligan@chromium.org0f521b02014-06-19 20:41:10 +0000496 'unpack_lib_output_dir':'<(INTERMEDIATE_DIR)',
497 'unpack_lib_name':'vp8_asm_enc_offsets.o'
michaelbai@google.com1d4fbbb2014-01-28 00:13:42 +0000498 },
499 'includes': ['unpack_lib_posix.gypi'],
phajdan.jr@chromium.orga2f53662013-05-02 22:02:06 +0000500 # Need this otherwise gyp won't run the rule on them.
501 'sources': [
502 '<(INTERMEDIATE_DIR)/vp8_asm_enc_offsets.o',
503 ],
504 }],
505 ],
michaelbai@google.com1d4fbbb2014-01-28 00:13:42 +0000506 'includes': ['obj_int_extract.gypi'],
phajdan.jr@chromium.orga2f53662013-05-02 22:02:06 +0000507 },
508 {
509 # A target that takes assembly offsets library and generate the
510 # corresponding assembly files.
511 # This target is a hard dependency because the generated .asm files
512 # are needed all assembly optimized files in libvpx.
513 'target_name': 'gen_asm_offsets_vpx_scale',
514 'type': 'none',
515 'hard_dependency': 1,
516 'dependencies': [
517 'libvpx_asm_offsets_vpx_scale',
518 'libvpx_obj_int_extract#host',
519 ],
michaelbai@google.com07718752014-01-15 19:12:47 +0000520 'variables' : {
fgalligan@chromium.org0f521b02014-06-19 20:41:10 +0000521 'lib_intermediate_name' : '',
michaelbai@google.com1d4fbbb2014-01-28 00:13:42 +0000522 'output_format':'',
523 'output_dir': '<(shared_generated_dir)',
michaelbai@google.com07718752014-01-15 19:12:47 +0000524 'conditions' : [
525 ['android_webview_build==1', {
michaelbai@chromium.org177bcf52014-04-03 23:37:53 +0000526 # pass the empty string for 3rd and 4th arguments of
527 # intermediates-dir-for macro.
fgalligan@chromium.org0f521b02014-06-19 20:41:10 +0000528 'lib_intermediate_name' : '$(abspath $(call intermediates-dir-for,STATIC_LIBRARIES,libvpx_asm_offsets_vpx_scale,,,$(gyp_var_prefix)))/libvpx_asm_offsets_vpx_scale.a',
fgalligan@chromium.orga1058f52014-05-28 16:05:57 +0000529 }],
michaelbai@google.com1d4fbbb2014-01-28 00:13:42 +0000530 ['(target_arch=="arm" or target_arch=="armv7")', {
531 'output_format': 'gas',
532 }, {
533 'output_format': 'rvds',
michaelbai@google.com07718752014-01-15 19:12:47 +0000534 }],
535 ],
536 },
phajdan.jr@chromium.orga2f53662013-05-02 22:02:06 +0000537 'conditions': [
538 ['OS=="win"', {
539 'variables': {
540 'ninja_obj_dir': '<(PRODUCT_DIR)/obj/third_party/libvpx/<(libvpx_source)/vpx_scale',
541 },
542 'actions': [
543 {
544 'action_name': 'copy_enc_offsets_obj',
fgalligan@chromium.org0f521b02014-06-19 20:41:10 +0000545 'inputs': [ 'copy_obj.py' ],
phajdan.jr@chromium.orga2f53662013-05-02 22:02:06 +0000546 'outputs': [ '<(INTERMEDIATE_DIR)/vpx_scale_asm_offsets.obj' ],
547 'action': [
dpranke@chromium.orgc9115182014-01-25 03:18:12 +0000548 'python',
549 '<(DEPTH)/third_party/libvpx/copy_obj.py',
phajdan.jr@chromium.orga2f53662013-05-02 22:02:06 +0000550 '-d', '<@(_outputs)',
fgalligan@chromium.org0f521b02014-06-19 20:41:10 +0000551 '-s', '<(PRODUCT_DIR)/obj/libvpx_asm_offsets_vpx_scale/vpx_scale_asm_offsets.obj',
phajdan.jr@chromium.orga2f53662013-05-02 22:02:06 +0000552 '-s', '<(ninja_obj_dir)/encoder/libvpx_asm_offsets_vpx_scale.vpx_scale_asm_offsets.obj',
fgalligan@chromium.org0f521b02014-06-19 20:41:10 +0000553 '-s', '<(PRODUCT_DIR)/obj/Source/WebKit/chromium/third_party/libvpx/<(libvpx_source)/vpx_scale/libvpx_asm_offsets_vpx_scale.vpx_scale_asm_offsets.obj',
phajdan.jr@chromium.orga2f53662013-05-02 22:02:06 +0000554 ],
tomfinegan@google.com962354e2014-08-13 18:34:31 +0000555 'process_outputs_as_sources': 1,
phajdan.jr@chromium.orga2f53662013-05-02 22:02:06 +0000556 },
557 ],
tomfinegan@chromium.org76b899c2014-08-15 06:02:52 +0000558 'sources': [
559 '<(INTERMEDIATE_DIR)/vpx_scale_asm_offsets.obj',
560 ],
phajdan.jr@chromium.orga2f53662013-05-02 22:02:06 +0000561 }, {
michaelbai@google.com1d4fbbb2014-01-28 00:13:42 +0000562 'variables': {
563 'unpack_lib_search_path_list': [
fgalligan@chromium.org0f521b02014-06-19 20:41:10 +0000564 '-a', '<(PRODUCT_DIR)/libvpx_asm_offsets_vpx_scale.a',
565 '-a', '<(LIB_DIR)/third_party/libvpx/libvpx_asm_offsets_vpx_scale.a',
kjellander@chromium.orgb80efbc2014-08-11 16:24:14 +0000566 '-a', '<(LIB_DIR)/chromium/src/third_party/libvpx/libvpx_asm_offsets_vpx_scale.a',
fgalligan@chromium.org0f521b02014-06-19 20:41:10 +0000567 '-a', '<(LIB_DIR)/Source/WebKit/chromium/third_party/libvpx/libvpx_asm_offsets_vpx_scale.a',
568 '-a', '<(lib_intermediate_name)',
michaelbai@google.com1d4fbbb2014-01-28 00:13:42 +0000569 ],
fgalligan@chromium.org0f521b02014-06-19 20:41:10 +0000570 'unpack_lib_output_dir':'<(INTERMEDIATE_DIR)',
571 'unpack_lib_name':'vpx_scale_asm_offsets.o'
michaelbai@google.com1d4fbbb2014-01-28 00:13:42 +0000572 },
573 'includes': ['unpack_lib_posix.gypi'],
tomfinegan@chromium.org76b899c2014-08-15 06:02:52 +0000574 # Need this otherwise gyp won't run the rule on them.
575 'sources': [
576 '<(INTERMEDIATE_DIR)/vpx_scale_asm_offsets.o',
577 ],
phajdan.jr@chromium.orga2f53662013-05-02 22:02:06 +0000578 }],
579 ],
michaelbai@google.com1d4fbbb2014-01-28 00:13:42 +0000580 'includes': ['obj_int_extract.gypi'],
phajdan.jr@chromium.orga2f53662013-05-02 22:02:06 +0000581 },
phajdan.jr@chromium.orga2f53662013-05-02 22:02:06 +0000582 ],
fbarchard@chromium.orgb82dd682010-11-03 17:34:40 +0000583}