OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 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 'variables': { | 5 'variables': { |
6 'conditions': [ | 6 'use_system_libvpx%': 0, |
7 ['os_posix==1', { | |
8 'asm_obj_extension': 'o', | |
9 }], | |
10 ['OS=="win"', { | |
11 'asm_obj_extension': 'obj', | |
12 }], | |
13 | |
14 ['target_arch=="arm" and arm_neon==1', { | |
15 'target_arch_full': 'arm-neon', | |
16 }, { | |
17 'target_arch_full': '<(target_arch)', | |
18 }], | |
19 | |
20 # Conversion to libvpx arch names. | |
21 ['target_arch=="arm" and arm_neon==1', { | |
22 'libvpx_arch': 'armv7', | |
23 }], | |
24 ['target_arch=="arm" and arm_neon==0', { | |
25 'libvpx_arch': 'armv6', | |
26 }], | |
27 ['target_arch=="ia32"', { | |
28 'libvpx_arch': 'x86', | |
29 }], | |
30 ['target_arch=="x64"', { | |
31 'libvpx_arch': 'x86_64', | |
32 }], | |
33 | |
34 ['os_posix == 1 and OS != "mac"', { | |
35 'OS_CATEGORY%': 'linux', | |
36 }, { | |
37 'OS_CATEGORY%': '<(OS)', | |
38 }], | |
39 ], | |
40 | |
41 # Location of the intermediate output. | |
42 'shared_generated_dir': '<(SHARED_INTERMEDIATE_DIR)/third_party/libvpx', | |
43 | |
44 # Override temporarily until we get a warning-free libvpx on Windows. | |
45 # See http://crbug.com/140121 | |
46 'win_third_party_warn_as_error': 'false', | |
47 }, | 7 }, |
48 | |
49 'conditions': [ | 8 'conditions': [ |
50 [ 'target_arch != "arm" and target_arch != "mipsel"', { | 9 ['use_system_libvpx==0', { |
| 10 'variables': { |
| 11 'conditions': [ |
| 12 ['os_posix==1', { |
| 13 'asm_obj_extension': 'o', |
| 14 }], |
| 15 ['OS=="win"', { |
| 16 'asm_obj_extension': 'obj', |
| 17 }], |
| 18 |
| 19 ['target_arch=="arm" and arm_neon==1', { |
| 20 'target_arch_full': 'arm-neon', |
| 21 }, { |
| 22 'target_arch_full': '<(target_arch)', |
| 23 }], |
| 24 |
| 25 # Conversion to libvpx arch names. |
| 26 ['target_arch=="arm" and arm_neon==1', { |
| 27 'libvpx_arch': 'armv7', |
| 28 }], |
| 29 ['target_arch=="arm" and arm_neon==0', { |
| 30 'libvpx_arch': 'armv6', |
| 31 }], |
| 32 ['target_arch=="ia32"', { |
| 33 'libvpx_arch': 'x86', |
| 34 }], |
| 35 ['target_arch=="x64"', { |
| 36 'libvpx_arch': 'x86_64', |
| 37 }], |
| 38 |
| 39 ['os_posix == 1 and OS != "mac"', { |
| 40 'OS_CATEGORY%': 'linux', |
| 41 }, { |
| 42 'OS_CATEGORY%': '<(OS)', |
| 43 }], |
| 44 ], |
| 45 |
| 46 # Location of the intermediate output. |
| 47 'shared_generated_dir': '<(SHARED_INTERMEDIATE_DIR)/third_party/libvpx', |
| 48 |
| 49 # Override temporarily until we get a warning-free libvpx on Windows. |
| 50 # See http://crbug.com/140121 |
| 51 'win_third_party_warn_as_error': 'false', |
| 52 }, |
| 53 |
| 54 'conditions': [ |
| 55 [ 'target_arch != "arm" and target_arch != "mipsel"', { |
| 56 'targets': [ |
| 57 { |
| 58 # This libvpx target contains both encoder and decoder. |
| 59 # Encoder is configured to be realtime only. |
| 60 'target_name': 'libvpx', |
| 61 'type': 'static_library', |
| 62 'variables': { |
| 63 'yasm_output_path': '<(SHARED_INTERMEDIATE_DIR)/third_party/libv
px', |
| 64 'OS_CATEGORY%': '<(OS_CATEGORY)', |
| 65 'yasm_flags': [ |
| 66 '-D', 'CHROMIUM', |
| 67 '-I', 'source/config/<(OS_CATEGORY)/<(target_arch)', |
| 68 '-I', 'source/config', |
| 69 '-I', 'source/libvpx', |
| 70 '-I', '<(shared_generated_dir)', # Generated assembly offsets |
| 71 ], |
| 72 }, |
| 73 'dependencies': [ |
| 74 'gen_asm_offsets', |
| 75 ], |
| 76 'includes': [ |
| 77 '../yasm/yasm_compile.gypi' |
| 78 ], |
| 79 'include_dirs': [ |
| 80 'source/config/<(OS_CATEGORY)/<(target_arch)', |
| 81 'source/config', |
| 82 'source/libvpx', |
| 83 'source/libvpx/vp8/common', |
| 84 'source/libvpx/vp8/decoder', |
| 85 'source/libvpx/vp8/encoder', |
| 86 '<(shared_generated_dir)', # Provides vpx_rtcd.h. |
| 87 ], |
| 88 'direct_dependent_settings': { |
| 89 'include_dirs': [ |
| 90 'source/libvpx', |
| 91 ], |
| 92 }, |
| 93 # VS2010 does not correctly incrementally link obj files generated |
| 94 # from asm files. This flag disables UseLibraryDependencyInputs to |
| 95 # avoid this problem. |
| 96 'msvs_2010_disable_uldi_when_referenced': 1, |
| 97 'conditions': [ |
| 98 [ 'target_arch=="ia32"', { |
| 99 'includes': [ |
| 100 'libvpx_srcs_x86.gypi', |
| 101 ], |
| 102 }], |
| 103 [ 'target_arch=="x64"', { |
| 104 'includes': [ |
| 105 'libvpx_srcs_x86_64.gypi', |
| 106 ], |
| 107 }], |
| 108 ['clang == 1', { |
| 109 'xcode_settings': { |
| 110 'WARNING_CFLAGS': [ |
| 111 # libvpx heavily relies on implicit enum casting. |
| 112 '-Wno-conversion', |
| 113 # libvpx does `if ((a == b))` in some places. |
| 114 '-Wno-parentheses-equality', |
| 115 ], |
| 116 }, |
| 117 'cflags': [ |
| 118 '-Wno-conversion', |
| 119 '-Wno-parentheses-equality', |
| 120 ], |
| 121 }], |
| 122 [ 'chromeos == 1', { |
| 123 # ChromeOS needs these files for animated WebM avatars. |
| 124 'sources': [ |
| 125 'source/libvpx/libmkv/EbmlIDs.h', |
| 126 'source/libvpx/libmkv/EbmlWriter.c', |
| 127 'source/libvpx/libmkv/EbmlWriter.h', |
| 128 ], |
| 129 }], |
| 130 ], |
| 131 }, |
| 132 ], |
| 133 }, |
| 134 ], |
| 135 # 'libvpx' target for mips builds. |
| 136 [ 'target_arch=="mipsel" ', { |
| 137 'targets': [ |
| 138 { |
| 139 # This libvpx target contains both encoder and decoder. |
| 140 # Encoder is configured to be realtime only. |
| 141 'target_name': 'libvpx', |
| 142 'type': 'static_library', |
| 143 'variables': { |
| 144 'shared_generated_dir': |
| 145 '<(SHARED_INTERMEDIATE_DIR)/third_party/libvpx', |
| 146 }, |
| 147 'includes': [ |
| 148 'libvpx_srcs_mips.gypi', |
| 149 ], |
| 150 'cflags': [ |
| 151 '-EL -static -mips32', |
| 152 ], |
| 153 'include_dirs': [ |
| 154 'source/config/<(OS)/<(target_arch)', |
| 155 'source/config', |
| 156 'source/libvpx', |
| 157 'source/libvpx/vp8/common', |
| 158 'source/libvpx/vp8/decoder', |
| 159 'source/libvpx/vp8/encoder', |
| 160 ], |
| 161 'direct_dependent_settings': { |
| 162 'include_dirs': [ |
| 163 'source/libvpx', |
| 164 ], |
| 165 }, |
| 166 'sources': [ |
| 167 'source/config/<(OS)/<(target_arch)/vpx_config.c', |
| 168 ], |
| 169 }, |
| 170 ], |
| 171 }, |
| 172 ], |
| 173 # 'libvpx' target for ARM builds. |
| 174 [ 'target_arch=="arm" ', { |
| 175 'targets': [ |
| 176 { |
| 177 # This libvpx target contains both encoder and decoder. |
| 178 # Encoder is configured to be realtime only. |
| 179 'target_name': 'libvpx', |
| 180 'type': 'static_library', |
| 181 'dependencies': [ |
| 182 'gen_asm_offsets', |
| 183 ], |
| 184 |
| 185 # Copy the script to the output folder so that we can use it with |
| 186 # absolute path. |
| 187 'copies': [{ |
| 188 'destination': '<(shared_generated_dir)', |
| 189 'files': [ |
| 190 '<(ads2gas_script_path)', |
| 191 ], |
| 192 }], |
| 193 |
| 194 # Rule to convert .asm files to .S files. |
| 195 'rules': [ |
| 196 { |
| 197 'rule_name': 'convert_asm', |
| 198 'extension': 'asm', |
| 199 'inputs': [ '<(shared_generated_dir)/<(ads2gas_script)', ], |
| 200 'outputs': [ |
| 201 '<(shared_generated_dir)/<(RULE_INPUT_ROOT).S', |
| 202 ], |
| 203 'action': [ |
| 204 'bash', |
| 205 '-c', |
| 206 'cat <(RULE_INPUT_PATH) | perl <(shared_generated_dir)/<(ads
2gas_script) > <(shared_generated_dir)/<(RULE_INPUT_ROOT).S', |
| 207 ], |
| 208 'process_outputs_as_sources': 1, |
| 209 'message': 'Convert libvpx asm file for ARM <(RULE_INPUT_PATH)
.', |
| 210 }, |
| 211 ], |
| 212 |
| 213 'variables': { |
| 214 # Location of the assembly conversion script. |
| 215 'ads2gas_script': 'ads2gas.pl', |
| 216 'ads2gas_script_path': 'source/libvpx/build/make/<(ads2gas_scrip
t)', |
| 217 }, |
| 218 'cflags': [ |
| 219 # We need to explicitly tell the GCC assembler to look for |
| 220 # .include directive files from the place where they're |
| 221 # generated to. |
| 222 '-Wa,-I,<!(pwd)/source/config/<(OS_CATEGORY)/<(target_arch_full)
', |
| 223 '-Wa,-I,<!(pwd)/source/config', |
| 224 '-Wa,-I,<(shared_generated_dir)', |
| 225 ], |
| 226 'include_dirs': [ |
| 227 'source/config/<(OS_CATEGORY)/<(target_arch_full)', |
| 228 'source/config', |
| 229 'source/libvpx', |
| 230 ], |
| 231 'direct_dependent_settings': { |
| 232 'include_dirs': [ |
| 233 'source/libvpx', |
| 234 ], |
| 235 }, |
| 236 'conditions': [ |
| 237 # Libvpx optimizations for ARMv6 or ARMv7 without NEON. |
| 238 ['arm_neon==0', { |
| 239 'includes': [ |
| 240 'libvpx_srcs_arm.gypi', |
| 241 ], |
| 242 }], |
| 243 # Libvpx optimizations for ARMv7 with NEON. |
| 244 ['arm_neon==1', { |
| 245 'includes': [ |
| 246 'libvpx_srcs_arm_neon.gypi', |
| 247 ], |
| 248 }], |
| 249 ['OS == "android"', { |
| 250 'include_dirs': [ |
| 251 '<(android_ndk_include)', |
| 252 '<(android_ndk_include)/machine', |
| 253 ], |
| 254 'defines': [ |
| 255 'ANDROID_CPU_ARM_FEATURE_NEON=4', |
| 256 ], |
| 257 }], |
| 258 [ 'chromeos == 1', { |
| 259 # ChromeOS needs these files for animated WebM avatars. |
| 260 'sources': [ |
| 261 'source/libvpx/libmkv/EbmlIDs.h', |
| 262 'source/libvpx/libmkv/EbmlWriter.c', |
| 263 'source/libvpx/libmkv/EbmlWriter.h', |
| 264 ], |
| 265 }], |
| 266 ], |
| 267 }, |
| 268 ], |
| 269 }], |
| 270 ], |
51 'targets': [ | 271 'targets': [ |
52 { | 272 { |
53 # This libvpx target contains both encoder and decoder. | 273 # A tool that runs on host to tract integers from object file. |
54 # Encoder is configured to be realtime only. | 274 'target_name': 'libvpx_obj_int_extract', |
55 'target_name': 'libvpx', | 275 'type': 'executable', |
56 'type': 'static_library', | 276 'toolsets': ['host'], |
57 'variables': { | |
58 'yasm_output_path': '<(SHARED_INTERMEDIATE_DIR)/third_party/libvpx', | |
59 'OS_CATEGORY%': '<(OS_CATEGORY)', | |
60 'yasm_flags': [ | |
61 '-D', 'CHROMIUM', | |
62 '-I', 'source/config/<(OS_CATEGORY)/<(target_arch)', | |
63 '-I', 'source/config', | |
64 '-I', 'source/libvpx', | |
65 '-I', '<(shared_generated_dir)', # Generated assembly offsets | |
66 ], | |
67 }, | |
68 'dependencies': [ | |
69 'gen_asm_offsets', | |
70 ], | |
71 'includes': [ | |
72 '../yasm/yasm_compile.gypi' | |
73 ], | |
74 'include_dirs': [ | |
75 'source/config/<(OS_CATEGORY)/<(target_arch)', | |
76 'source/config', | |
77 'source/libvpx', | |
78 'source/libvpx/vp8/common', | |
79 'source/libvpx/vp8/decoder', | |
80 'source/libvpx/vp8/encoder', | |
81 '<(shared_generated_dir)', # Provides vpx_rtcd.h. | |
82 ], | |
83 'direct_dependent_settings': { | |
84 'include_dirs': [ | |
85 'source/libvpx', | |
86 ], | |
87 }, | |
88 # VS2010 does not correctly incrementally link obj files generated | |
89 # from asm files. This flag disables UseLibraryDependencyInputs to | |
90 # avoid this problem. | |
91 'msvs_2010_disable_uldi_when_referenced': 1, | |
92 'conditions': [ | |
93 [ 'target_arch=="ia32"', { | |
94 'includes': [ | |
95 'libvpx_srcs_x86.gypi', | |
96 ], | |
97 }], | |
98 [ 'target_arch=="x64"', { | |
99 'includes': [ | |
100 'libvpx_srcs_x86_64.gypi', | |
101 ], | |
102 }], | |
103 ['clang == 1', { | |
104 'xcode_settings': { | |
105 'WARNING_CFLAGS': [ | |
106 # libvpx heavily relies on implicit enum casting. | |
107 '-Wno-conversion', | |
108 # libvpx does `if ((a == b))` in some places. | |
109 '-Wno-parentheses-equality', | |
110 ], | |
111 }, | |
112 'cflags': [ | |
113 '-Wno-conversion', | |
114 '-Wno-parentheses-equality', | |
115 ], | |
116 }], | |
117 [ 'chromeos == 1', { | |
118 # ChromeOS needs these files for animated WebM avatars. | |
119 'sources': [ | |
120 'source/libvpx/libmkv/EbmlIDs.h', | |
121 'source/libvpx/libmkv/EbmlWriter.c', | |
122 'source/libvpx/libmkv/EbmlWriter.h', | |
123 ], | |
124 }], | |
125 ], | |
126 }, | |
127 ], | |
128 }, | |
129 ], | |
130 # 'libvpx' target for mips builds. | |
131 [ 'target_arch=="mipsel" ', { | |
132 'targets': [ | |
133 { | |
134 # This libvpx target contains both encoder and decoder. | |
135 # Encoder is configured to be realtime only. | |
136 'target_name': 'libvpx', | |
137 'type': 'static_library', | |
138 'variables': { | |
139 'shared_generated_dir': | |
140 '<(SHARED_INTERMEDIATE_DIR)/third_party/libvpx', | |
141 }, | |
142 'includes': [ | |
143 'libvpx_srcs_mips.gypi', | |
144 ], | |
145 'cflags': [ | |
146 '-EL -static -mips32', | |
147 ], | |
148 'include_dirs': [ | |
149 'source/config/<(OS)/<(target_arch)', | |
150 'source/config', | |
151 'source/libvpx', | |
152 'source/libvpx/vp8/common', | |
153 'source/libvpx/vp8/decoder', | |
154 'source/libvpx/vp8/encoder', | |
155 ], | |
156 'direct_dependent_settings': { | |
157 'include_dirs': [ | |
158 'source/libvpx', | |
159 ], | |
160 }, | |
161 'sources': [ | |
162 'source/config/<(OS)/<(target_arch)/vpx_config.c', | |
163 ], | |
164 }, | |
165 ], | |
166 }, | |
167 ], | |
168 # 'libvpx' target for ARM builds. | |
169 [ 'target_arch=="arm" ', { | |
170 'targets': [ | |
171 { | |
172 # This libvpx target contains both encoder and decoder. | |
173 # Encoder is configured to be realtime only. | |
174 'target_name': 'libvpx', | |
175 'type': 'static_library', | |
176 'dependencies': [ | |
177 'gen_asm_offsets', | |
178 ], | |
179 | |
180 # Copy the script to the output folder so that we can use it with | |
181 # absolute path. | |
182 'copies': [{ | |
183 'destination': '<(shared_generated_dir)', | |
184 'files': [ | |
185 '<(ads2gas_script_path)', | |
186 ], | |
187 }], | |
188 | |
189 # Rule to convert .asm files to .S files. | |
190 'rules': [ | |
191 { | |
192 'rule_name': 'convert_asm', | |
193 'extension': 'asm', | |
194 'inputs': [ '<(shared_generated_dir)/<(ads2gas_script)', ], | |
195 'outputs': [ | |
196 '<(shared_generated_dir)/<(RULE_INPUT_ROOT).S', | |
197 ], | |
198 'action': [ | |
199 'bash', | |
200 '-c', | |
201 'cat <(RULE_INPUT_PATH) | perl <(shared_generated_dir)/<(ads2gas
_script) > <(shared_generated_dir)/<(RULE_INPUT_ROOT).S', | |
202 ], | |
203 'process_outputs_as_sources': 1, | |
204 'message': 'Convert libvpx asm file for ARM <(RULE_INPUT_PATH).', | |
205 }, | |
206 ], | |
207 | |
208 'variables': { | |
209 # Location of the assembly conversion script. | |
210 'ads2gas_script': 'ads2gas.pl', | |
211 'ads2gas_script_path': 'source/libvpx/build/make/<(ads2gas_script)', | |
212 }, | |
213 'cflags': [ | |
214 # We need to explicitly tell the GCC assembler to look for | |
215 # .include directive files from the place where they're | |
216 # generated to. | |
217 '-Wa,-I,<!(pwd)/source/config/<(OS_CATEGORY)/<(target_arch_full)', | |
218 '-Wa,-I,<!(pwd)/source/config', | |
219 '-Wa,-I,<(shared_generated_dir)', | |
220 ], | |
221 'include_dirs': [ | 277 'include_dirs': [ |
222 'source/config/<(OS_CATEGORY)/<(target_arch_full)', | 278 'source/config/<(OS_CATEGORY)/<(target_arch_full)', |
223 'source/config', | 279 'source/config', |
224 'source/libvpx', | 280 'source/libvpx', |
225 ], | 281 ], |
| 282 'sources': [ |
| 283 'source/libvpx/build/make/obj_int_extract.c', |
| 284 ] |
| 285 }, |
| 286 { |
| 287 # A library that contains assembly offsets needed. |
| 288 'target_name': 'libvpx_asm_offsets', |
| 289 'type': 'static_library', |
| 290 'hard_dependency': 1, |
| 291 'include_dirs': [ |
| 292 'source/config/<(OS_CATEGORY)/<(target_arch_full)', |
| 293 'source/config', |
| 294 'source/libvpx', |
| 295 ], |
| 296 'conditions': [ |
| 297 ['asan==1', { |
| 298 'cflags!': [ '-faddress-sanitizer', ], |
| 299 'xcode_settings': { |
| 300 'OTHER_CFLAGS!': [ '-faddress-sanitizer', ], |
| 301 }, |
| 302 'ldflags!': [ '-faddress-sanitizer', ], |
| 303 }], |
| 304 ], |
| 305 'sources': [ |
| 306 '<(shared_generated_dir)/vpx_rtcd.h', |
| 307 'source/libvpx/vp8/common/asm_com_offsets.c', |
| 308 'source/libvpx/vp8/decoder/asm_dec_offsets.c', |
| 309 'source/libvpx/vp8/encoder/asm_enc_offsets.c', |
| 310 ], |
| 311 }, |
| 312 { |
| 313 # A target that takes assembly offsets library and generate the |
| 314 # corresponding assembly files. |
| 315 # This target is a hard dependency because the generated .asm files |
| 316 # are needed all assembly optimized files in libvpx. |
| 317 'target_name': 'gen_asm_offsets', |
| 318 'type': 'none', |
| 319 'hard_dependency': 1, |
| 320 'dependencies': [ |
| 321 'libvpx_asm_offsets', |
| 322 'libvpx_obj_int_extract#host', |
| 323 ], |
| 324 'conditions': [ |
| 325 ['OS=="win"', { |
| 326 'variables': { |
| 327 'ninja_obj_dir': '<(PRODUCT_DIR)/obj/third_party/libvpx/source/l
ibvpx/vp8', |
| 328 }, |
| 329 'actions': [ |
| 330 { |
| 331 'action_name': 'copy_enc_offsets_obj', |
| 332 'inputs': [ 'copy_obj.sh' ], |
| 333 'outputs': [ '<(INTERMEDIATE_DIR)/asm_enc_offsets.obj' ], |
| 334 'action': [ |
| 335 '<(DEPTH)/third_party/libvpx/copy_obj.sh', |
| 336 '-d', '<@(_outputs)', |
| 337 '-s', '<(PRODUCT_DIR)/obj/libvpx_asm_offsets/asm_enc_offsets
.obj', |
| 338 '-s', '<(ninja_obj_dir)/encoder/libvpx_asm_offsets.asm_enc_o
ffsets.obj', |
| 339 ], |
| 340 'process_output_as_sources': 1, |
| 341 }, |
| 342 { |
| 343 'action_name': 'copy_dec_offsets_obj', |
| 344 'inputs': [ 'copy_obj.sh' ], |
| 345 'outputs': [ '<(INTERMEDIATE_DIR)/asm_dec_offsets.obj' ], |
| 346 'action': [ |
| 347 '<(DEPTH)/third_party/libvpx/copy_obj.sh', |
| 348 '-d', '<@(_outputs)', |
| 349 '-s', '<(PRODUCT_DIR)/obj/libvpx_asm_offsets/asm_dec_offsets
.obj', |
| 350 '-s', '<(ninja_obj_dir)/decoder/libvpx_asm_offsets.asm_dec_o
ffsets.obj', |
| 351 ], |
| 352 'process_output_as_sources': 1, |
| 353 }, |
| 354 { |
| 355 'action_name': 'copy_com_offsets_obj', |
| 356 'inputs': [ 'copy_obj.sh' ], |
| 357 'outputs': [ '<(INTERMEDIATE_DIR)/asm_com_offsets.obj' ], |
| 358 'action': [ |
| 359 '<(DEPTH)/third_party/libvpx/copy_obj.sh', |
| 360 '-d', '<@(_outputs)', |
| 361 '-s', '<(PRODUCT_DIR)/obj/libvpx_asm_offsets/asm_com_offsets
.obj', |
| 362 '-s', '<(ninja_obj_dir)/common/libvpx_asm_offsets.asm_com_of
fsets.obj', |
| 363 ], |
| 364 'process_output_as_sources': 1, |
| 365 }, |
| 366 ], |
| 367 'sources': [ |
| 368 '<(INTERMEDIATE_DIR)/asm_com_offsets.obj', |
| 369 '<(INTERMEDIATE_DIR)/asm_dec_offsets.obj', |
| 370 '<(INTERMEDIATE_DIR)/asm_enc_offsets.obj', |
| 371 ], |
| 372 }, { |
| 373 'actions': [ |
| 374 { |
| 375 # Take archived .a file and unpack it unto .o files. |
| 376 'action_name': 'unpack_lib_posix', |
| 377 'inputs': [ |
| 378 'unpack_lib_posix.sh', |
| 379 ], |
| 380 'outputs': [ |
| 381 '<(INTERMEDIATE_DIR)/asm_com_offsets.o', |
| 382 '<(INTERMEDIATE_DIR)/asm_dec_offsets.o', |
| 383 '<(INTERMEDIATE_DIR)/asm_enc_offsets.o', |
| 384 ], |
| 385 'action': [ |
| 386 '<(DEPTH)/third_party/libvpx/unpack_lib_posix.sh', |
| 387 '-d', '<(INTERMEDIATE_DIR)', |
| 388 '-a', '<(LIB_DIR)/libvpx_asm_offsets.a', |
| 389 '-a', '<(LIB_DIR)/third_party/libvpx/libvpx_asm_offsets.a', |
| 390 '-f', 'asm_com_offsets.o', |
| 391 '-f', 'asm_dec_offsets.o', |
| 392 '-f', 'asm_enc_offsets.o', |
| 393 ], |
| 394 'process_output_as_sources': 1, |
| 395 }, |
| 396 ], |
| 397 # Need this otherwise gyp won't run the rule on them. |
| 398 'sources': [ |
| 399 '<(INTERMEDIATE_DIR)/asm_com_offsets.o', |
| 400 '<(INTERMEDIATE_DIR)/asm_dec_offsets.o', |
| 401 '<(INTERMEDIATE_DIR)/asm_enc_offsets.o', |
| 402 ], |
| 403 }], |
| 404 ], |
| 405 'rules': [ |
| 406 { |
| 407 # Rule to extract integer values for each symbol from an object fi
le. |
| 408 'rule_name': 'obj_int_extract', |
| 409 'extension': '<(asm_obj_extension)', |
| 410 'inputs': [ |
| 411 '<(PRODUCT_DIR)/libvpx_obj_int_extract', |
| 412 'obj_int_extract.sh', |
| 413 ], |
| 414 'outputs': [ |
| 415 '<(shared_generated_dir)/<(RULE_INPUT_ROOT).asm', |
| 416 ], |
| 417 'variables': { |
| 418 'conditions': [ |
| 419 ['target_arch=="arm"', { |
| 420 'asm_format': 'gas', |
| 421 }, { |
| 422 'asm_format': 'rvds', |
| 423 }], |
| 424 ], |
| 425 }, |
| 426 'action': [ |
| 427 '<(DEPTH)/third_party/libvpx/obj_int_extract.sh', |
| 428 '-e', '<(PRODUCT_DIR)/libvpx_obj_int_extract', |
| 429 '-f', '<(asm_format)', |
| 430 '-b', '<(RULE_INPUT_PATH)', |
| 431 '-o', '<(shared_generated_dir)/<(RULE_INPUT_ROOT).asm', |
| 432 ], |
| 433 'message': 'Generate assembly offsets <(RULE_INPUT_PATH).', |
| 434 }, |
| 435 ], |
| 436 }, |
| 437 { |
| 438 'target_name': 'simple_encoder', |
| 439 'type': 'executable', |
| 440 'dependencies': [ |
| 441 'libvpx', |
| 442 ], |
| 443 |
| 444 # Copy the script to the output folder so that we can use it with |
| 445 # absolute path. |
| 446 'copies': [{ |
| 447 'destination': '<(shared_generated_dir)/simple_encoder', |
| 448 'files': [ |
| 449 'source/libvpx/examples/gen_example_code.sh', |
| 450 ], |
| 451 }], |
| 452 |
| 453 # Rule to convert .txt files to .c files. |
| 454 'rules': [ |
| 455 { |
| 456 'rule_name': 'generate_example', |
| 457 'extension': 'txt', |
| 458 'inputs': [ '<(shared_generated_dir)/simple_encoder/gen_example_co
de.sh', ], |
| 459 'outputs': [ |
| 460 '<(shared_generated_dir)/<(RULE_INPUT_ROOT).c', |
| 461 ], |
| 462 'action': [ |
| 463 'bash', |
| 464 '-c', |
| 465 '<(shared_generated_dir)/simple_encoder/gen_example_code.sh <(RU
LE_INPUT_PATH) > <(shared_generated_dir)/<(RULE_INPUT_ROOT).c', |
| 466 ], |
| 467 'process_outputs_as_sources': 1, |
| 468 'message': 'Generate libvpx example code <(RULE_INPUT_PATH).', |
| 469 }, |
| 470 ], |
| 471 'sources': [ |
| 472 'source/libvpx/examples/simple_encoder.txt', |
| 473 ] |
| 474 }, |
| 475 { |
| 476 'target_name': 'simple_decoder', |
| 477 'type': 'executable', |
| 478 'dependencies': [ |
| 479 'libvpx', |
| 480 ], |
| 481 |
| 482 # Copy the script to the output folder so that we can use it with |
| 483 # absolute path. |
| 484 'copies': [{ |
| 485 'destination': '<(shared_generated_dir)/simple_decoder', |
| 486 'files': [ |
| 487 'source/libvpx/examples/gen_example_code.sh', |
| 488 ], |
| 489 }], |
| 490 |
| 491 # Rule to convert .txt files to .c files. |
| 492 'rules': [ |
| 493 { |
| 494 'rule_name': 'generate_example', |
| 495 'extension': 'txt', |
| 496 'inputs': [ '<(shared_generated_dir)/simple_decoder/gen_example_co
de.sh', ], |
| 497 'outputs': [ |
| 498 '<(shared_generated_dir)/<(RULE_INPUT_ROOT).c', |
| 499 ], |
| 500 'action': [ |
| 501 'bash', |
| 502 '-c', |
| 503 '<(shared_generated_dir)/simple_decoder/gen_example_code.sh <(RU
LE_INPUT_PATH) > <(shared_generated_dir)/<(RULE_INPUT_ROOT).c', |
| 504 ], |
| 505 'process_outputs_as_sources': 1, |
| 506 'message': 'Generate libvpx example code <(RULE_INPUT_PATH).', |
| 507 }, |
| 508 ], |
| 509 'sources': [ |
| 510 'source/libvpx/examples/simple_decoder.txt', |
| 511 ] |
| 512 }, |
| 513 ], |
| 514 }, { # use_system_libvpx==1 |
| 515 'targets': [ |
| 516 { |
| 517 'target_name': 'libvpx', |
| 518 'type': 'none', |
226 'direct_dependent_settings': { | 519 'direct_dependent_settings': { |
227 'include_dirs': [ | 520 'cflags': [ |
228 'source/libvpx', | 521 '<!@(pkg-config --cflags vpx)', |
| 522 ], |
| 523 'defines': [ |
| 524 'USE_SYSTEM_LIBVPX', |
229 ], | 525 ], |
230 }, | 526 }, |
231 'conditions': [ | 527 'link_settings': { |
232 # Libvpx optimizations for ARMv6 or ARMv7 without NEON. | 528 'ldflags': [ |
233 ['arm_neon==0', { | 529 '<!@(pkg-config --libs-only-L --libs-only-other vpx)', |
234 'includes': [ | 530 ], |
235 'libvpx_srcs_arm.gypi', | 531 'libraries': [ |
236 ], | 532 '<!@(pkg-config --libs-only-l vpx)', |
237 }], | 533 ], |
238 # Libvpx optimizations for ARMv7 with NEON. | 534 }, |
239 ['arm_neon==1', { | |
240 'includes': [ | |
241 'libvpx_srcs_arm_neon.gypi', | |
242 ], | |
243 }], | |
244 ['OS == "android"', { | |
245 'include_dirs': [ | |
246 '<(android_ndk_include)', | |
247 '<(android_ndk_include)/machine', | |
248 ], | |
249 'defines': [ | |
250 'ANDROID_CPU_ARM_FEATURE_NEON=4', | |
251 ], | |
252 }], | |
253 [ 'chromeos == 1', { | |
254 # ChromeOS needs these files for animated WebM avatars. | |
255 'sources': [ | |
256 'source/libvpx/libmkv/EbmlIDs.h', | |
257 'source/libvpx/libmkv/EbmlWriter.c', | |
258 'source/libvpx/libmkv/EbmlWriter.h', | |
259 ], | |
260 }], | |
261 ], | |
262 }, | 535 }, |
263 ], | 536 ], |
264 }], | 537 }], |
265 ], | 538 ], |
266 'targets': [ | |
267 { | |
268 # A tool that runs on host to tract integers from object file. | |
269 'target_name': 'libvpx_obj_int_extract', | |
270 'type': 'executable', | |
271 'toolsets': ['host'], | |
272 'include_dirs': [ | |
273 'source/config/<(OS_CATEGORY)/<(target_arch_full)', | |
274 'source/config', | |
275 'source/libvpx', | |
276 ], | |
277 'sources': [ | |
278 'source/libvpx/build/make/obj_int_extract.c', | |
279 ] | |
280 }, | |
281 { | |
282 # A library that contains assembly offsets needed. | |
283 'target_name': 'libvpx_asm_offsets', | |
284 'type': 'static_library', | |
285 'hard_dependency': 1, | |
286 'include_dirs': [ | |
287 'source/config/<(OS_CATEGORY)/<(target_arch_full)', | |
288 'source/config', | |
289 'source/libvpx', | |
290 ], | |
291 'conditions': [ | |
292 ['asan==1', { | |
293 'cflags!': [ '-faddress-sanitizer', ], | |
294 'xcode_settings': { | |
295 'OTHER_CFLAGS!': [ '-faddress-sanitizer', ], | |
296 }, | |
297 'ldflags!': [ '-faddress-sanitizer', ], | |
298 }], | |
299 ], | |
300 'sources': [ | |
301 '<(shared_generated_dir)/vpx_rtcd.h', | |
302 'source/libvpx/vp8/common/asm_com_offsets.c', | |
303 'source/libvpx/vp8/decoder/asm_dec_offsets.c', | |
304 'source/libvpx/vp8/encoder/asm_enc_offsets.c', | |
305 ], | |
306 }, | |
307 { | |
308 # A target that takes assembly offsets library and generate the | |
309 # corresponding assembly files. | |
310 # This target is a hard dependency because the generated .asm files | |
311 # are needed all assembly optimized files in libvpx. | |
312 'target_name': 'gen_asm_offsets', | |
313 'type': 'none', | |
314 'hard_dependency': 1, | |
315 'dependencies': [ | |
316 'libvpx_asm_offsets', | |
317 'libvpx_obj_int_extract#host', | |
318 ], | |
319 'conditions': [ | |
320 ['OS=="win"', { | |
321 'variables': { | |
322 'ninja_obj_dir': '<(PRODUCT_DIR)/obj/third_party/libvpx/source/libvp
x/vp8', | |
323 }, | |
324 'actions': [ | |
325 { | |
326 'action_name': 'copy_enc_offsets_obj', | |
327 'inputs': [ 'copy_obj.sh' ], | |
328 'outputs': [ '<(INTERMEDIATE_DIR)/asm_enc_offsets.obj' ], | |
329 'action': [ | |
330 '<(DEPTH)/third_party/libvpx/copy_obj.sh', | |
331 '-d', '<@(_outputs)', | |
332 '-s', '<(PRODUCT_DIR)/obj/libvpx_asm_offsets/asm_enc_offsets.obj
', | |
333 '-s', '<(ninja_obj_dir)/encoder/libvpx_asm_offsets.asm_enc_offse
ts.obj', | |
334 ], | |
335 'process_output_as_sources': 1, | |
336 }, | |
337 { | |
338 'action_name': 'copy_dec_offsets_obj', | |
339 'inputs': [ 'copy_obj.sh' ], | |
340 'outputs': [ '<(INTERMEDIATE_DIR)/asm_dec_offsets.obj' ], | |
341 'action': [ | |
342 '<(DEPTH)/third_party/libvpx/copy_obj.sh', | |
343 '-d', '<@(_outputs)', | |
344 '-s', '<(PRODUCT_DIR)/obj/libvpx_asm_offsets/asm_dec_offsets.obj
', | |
345 '-s', '<(ninja_obj_dir)/decoder/libvpx_asm_offsets.asm_dec_offse
ts.obj', | |
346 ], | |
347 'process_output_as_sources': 1, | |
348 }, | |
349 { | |
350 'action_name': 'copy_com_offsets_obj', | |
351 'inputs': [ 'copy_obj.sh' ], | |
352 'outputs': [ '<(INTERMEDIATE_DIR)/asm_com_offsets.obj' ], | |
353 'action': [ | |
354 '<(DEPTH)/third_party/libvpx/copy_obj.sh', | |
355 '-d', '<@(_outputs)', | |
356 '-s', '<(PRODUCT_DIR)/obj/libvpx_asm_offsets/asm_com_offsets.obj
', | |
357 '-s', '<(ninja_obj_dir)/common/libvpx_asm_offsets.asm_com_offset
s.obj', | |
358 ], | |
359 'process_output_as_sources': 1, | |
360 }, | |
361 ], | |
362 'sources': [ | |
363 '<(INTERMEDIATE_DIR)/asm_com_offsets.obj', | |
364 '<(INTERMEDIATE_DIR)/asm_dec_offsets.obj', | |
365 '<(INTERMEDIATE_DIR)/asm_enc_offsets.obj', | |
366 ], | |
367 }, { | |
368 'actions': [ | |
369 { | |
370 # Take archived .a file and unpack it unto .o files. | |
371 'action_name': 'unpack_lib_posix', | |
372 'inputs': [ | |
373 'unpack_lib_posix.sh', | |
374 ], | |
375 'outputs': [ | |
376 '<(INTERMEDIATE_DIR)/asm_com_offsets.o', | |
377 '<(INTERMEDIATE_DIR)/asm_dec_offsets.o', | |
378 '<(INTERMEDIATE_DIR)/asm_enc_offsets.o', | |
379 ], | |
380 'action': [ | |
381 '<(DEPTH)/third_party/libvpx/unpack_lib_posix.sh', | |
382 '-d', '<(INTERMEDIATE_DIR)', | |
383 '-a', '<(LIB_DIR)/libvpx_asm_offsets.a', | |
384 '-a', '<(LIB_DIR)/third_party/libvpx/libvpx_asm_offsets.a', | |
385 '-f', 'asm_com_offsets.o', | |
386 '-f', 'asm_dec_offsets.o', | |
387 '-f', 'asm_enc_offsets.o', | |
388 ], | |
389 'process_output_as_sources': 1, | |
390 }, | |
391 ], | |
392 # Need this otherwise gyp won't run the rule on them. | |
393 'sources': [ | |
394 '<(INTERMEDIATE_DIR)/asm_com_offsets.o', | |
395 '<(INTERMEDIATE_DIR)/asm_dec_offsets.o', | |
396 '<(INTERMEDIATE_DIR)/asm_enc_offsets.o', | |
397 ], | |
398 }], | |
399 ], | |
400 'rules': [ | |
401 { | |
402 # Rule to extract integer values for each symbol from an object file. | |
403 'rule_name': 'obj_int_extract', | |
404 'extension': '<(asm_obj_extension)', | |
405 'inputs': [ | |
406 '<(PRODUCT_DIR)/libvpx_obj_int_extract', | |
407 'obj_int_extract.sh', | |
408 ], | |
409 'outputs': [ | |
410 '<(shared_generated_dir)/<(RULE_INPUT_ROOT).asm', | |
411 ], | |
412 'variables': { | |
413 'conditions': [ | |
414 ['target_arch=="arm"', { | |
415 'asm_format': 'gas', | |
416 }, { | |
417 'asm_format': 'rvds', | |
418 }], | |
419 ], | |
420 }, | |
421 'action': [ | |
422 '<(DEPTH)/third_party/libvpx/obj_int_extract.sh', | |
423 '-e', '<(PRODUCT_DIR)/libvpx_obj_int_extract', | |
424 '-f', '<(asm_format)', | |
425 '-b', '<(RULE_INPUT_PATH)', | |
426 '-o', '<(shared_generated_dir)/<(RULE_INPUT_ROOT).asm', | |
427 ], | |
428 'message': 'Generate assembly offsets <(RULE_INPUT_PATH).', | |
429 }, | |
430 ], | |
431 }, | |
432 { | |
433 'target_name': 'simple_encoder', | |
434 'type': 'executable', | |
435 'dependencies': [ | |
436 'libvpx', | |
437 ], | |
438 | |
439 # Copy the script to the output folder so that we can use it with | |
440 # absolute path. | |
441 'copies': [{ | |
442 'destination': '<(shared_generated_dir)/simple_encoder', | |
443 'files': [ | |
444 'source/libvpx/examples/gen_example_code.sh', | |
445 ], | |
446 }], | |
447 | |
448 # Rule to convert .txt files to .c files. | |
449 'rules': [ | |
450 { | |
451 'rule_name': 'generate_example', | |
452 'extension': 'txt', | |
453 'inputs': [ '<(shared_generated_dir)/simple_encoder/gen_example_code.s
h', ], | |
454 'outputs': [ | |
455 '<(shared_generated_dir)/<(RULE_INPUT_ROOT).c', | |
456 ], | |
457 'action': [ | |
458 'bash', | |
459 '-c', | |
460 '<(shared_generated_dir)/simple_encoder/gen_example_code.sh <(RULE_I
NPUT_PATH) > <(shared_generated_dir)/<(RULE_INPUT_ROOT).c', | |
461 ], | |
462 'process_outputs_as_sources': 1, | |
463 'message': 'Generate libvpx example code <(RULE_INPUT_PATH).', | |
464 }, | |
465 ], | |
466 'sources': [ | |
467 'source/libvpx/examples/simple_encoder.txt', | |
468 ] | |
469 }, | |
470 { | |
471 'target_name': 'simple_decoder', | |
472 'type': 'executable', | |
473 'dependencies': [ | |
474 'libvpx', | |
475 ], | |
476 | |
477 # Copy the script to the output folder so that we can use it with | |
478 # absolute path. | |
479 'copies': [{ | |
480 'destination': '<(shared_generated_dir)/simple_decoder', | |
481 'files': [ | |
482 'source/libvpx/examples/gen_example_code.sh', | |
483 ], | |
484 }], | |
485 | |
486 # Rule to convert .txt files to .c files. | |
487 'rules': [ | |
488 { | |
489 'rule_name': 'generate_example', | |
490 'extension': 'txt', | |
491 'inputs': [ '<(shared_generated_dir)/simple_decoder/gen_example_code.s
h', ], | |
492 'outputs': [ | |
493 '<(shared_generated_dir)/<(RULE_INPUT_ROOT).c', | |
494 ], | |
495 'action': [ | |
496 'bash', | |
497 '-c', | |
498 '<(shared_generated_dir)/simple_decoder/gen_example_code.sh <(RULE_I
NPUT_PATH) > <(shared_generated_dir)/<(RULE_INPUT_ROOT).c', | |
499 ], | |
500 'process_outputs_as_sources': 1, | |
501 'message': 'Generate libvpx example code <(RULE_INPUT_PATH).', | |
502 }, | |
503 ], | |
504 'sources': [ | |
505 'source/libvpx/examples/simple_decoder.txt', | |
506 ] | |
507 }, | |
508 ], | |
509 } | 539 } |
510 | 540 |
511 # Local Variables: | 541 # Local Variables: |
512 # tab-width:2 | 542 # tab-width:2 |
513 # indent-tabs-mode:nil | 543 # indent-tabs-mode:nil |
514 # End: | 544 # End: |
515 # vim: set expandtab tabstop=2 shiftwidth=2: | 545 # vim: set expandtab tabstop=2 shiftwidth=2: |
OLD | NEW |