blob: 18d70ed2eb57f9af7d5f9a398c86d3607378c5f4 [file] [log] [blame]
msarett1c8a5872015-07-07 08:50:01 -07001# 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
3# found in the LICENSE file.
4
5{
6 'xcode_settings': {
7 'SYMROOT': '<(DEPTH)/xcodebuild',
8 },
9 'variables': {
10 'shared_generated_dir': '<(SHARED_INTERMEDIATE_DIR)/third_party/externals/libjpeg-turbo',
11 'conditions': [
12 [ 'skia_os == "win"', {
13 'object_suffix': 'obj',
14 }, {
15 'object_suffix': 'o',
16 }],
17 ],
18 },
19 'targets': [
20 {
msarett718e41d2015-07-10 10:59:47 -070021 'target_name': 'yasm-win',
22 'type': 'executable',
23 'sources': [
24 '../third_party/externals/yasm/binaries/win/yasm.exe',
25 ],
26 'copies' : [{
27 'destination': '<(PRODUCT_DIR)',
28 'files': [ '../third_party/externals/yasm/binaries/win/yasm.exe' ],
29 }],
30 },
31 {
msarett1c8a5872015-07-07 08:50:01 -070032 'target_name': 'libjpeg-turbo',
33 'type': 'static_library',
34 'include_dirs': [
35 '../third_party/externals/libjpeg-turbo/',
36 ],
37 'defines': [
38 'WITH_SIMD',
39 'MOTION_JPEG_SUPPORTED',
40 'NO_GETENV',
41 ],
42 'cflags': [
43 '-w', # supresses warnings
44 ],
45 'msvs_settings': {
46 'VCCLCompilerTool': {
msarett718e41d2015-07-10 10:59:47 -070047 'WarningLevel': '0',
msarett1c8a5872015-07-07 08:50:01 -070048 },
49 },
50 'xcode_settings': {
51 'WARNING_CFLAGS': [
52 '-w',
53 ],
54 },
55 'sources': [
56 '../third_party/externals/libjpeg-turbo/jaricom.c',
57 '../third_party/externals/libjpeg-turbo/jcapimin.c',
58 '../third_party/externals/libjpeg-turbo/jcapistd.c',
59 '../third_party/externals/libjpeg-turbo/jcarith.c',
60 '../third_party/externals/libjpeg-turbo/jccoefct.c',
61 '../third_party/externals/libjpeg-turbo/jccolor.c',
62 '../third_party/externals/libjpeg-turbo/jcdctmgr.c',
63 '../third_party/externals/libjpeg-turbo/jchuff.c',
64 '../third_party/externals/libjpeg-turbo/jchuff.h',
65 '../third_party/externals/libjpeg-turbo/jcinit.c',
66 '../third_party/externals/libjpeg-turbo/jcmainct.c',
67 '../third_party/externals/libjpeg-turbo/jcmarker.c',
68 '../third_party/externals/libjpeg-turbo/jcmaster.c',
69 '../third_party/externals/libjpeg-turbo/jcomapi.c',
70 '../third_party/externals/libjpeg-turbo/jconfig.h',
71 '../third_party/externals/libjpeg-turbo/jconfigint.h',
72 '../third_party/externals/libjpeg-turbo/jcparam.c',
73 '../third_party/externals/libjpeg-turbo/jcphuff.c',
74 '../third_party/externals/libjpeg-turbo/jcprepct.c',
75 '../third_party/externals/libjpeg-turbo/jcsample.c',
76 '../third_party/externals/libjpeg-turbo/jdapimin.c',
77 '../third_party/externals/libjpeg-turbo/jdapistd.c',
78 '../third_party/externals/libjpeg-turbo/jdarith.c',
79 '../third_party/externals/libjpeg-turbo/jdcoefct.c',
80 '../third_party/externals/libjpeg-turbo/jdcolor.c',
81 '../third_party/externals/libjpeg-turbo/jdct.h',
82 '../third_party/externals/libjpeg-turbo/jddctmgr.c',
83 '../third_party/externals/libjpeg-turbo/jdhuff.c',
84 '../third_party/externals/libjpeg-turbo/jdhuff.h',
85 '../third_party/externals/libjpeg-turbo/jdinput.c',
86 '../third_party/externals/libjpeg-turbo/jdmainct.c',
87 '../third_party/externals/libjpeg-turbo/jdmarker.c',
88 '../third_party/externals/libjpeg-turbo/jdmaster.c',
89 '../third_party/externals/libjpeg-turbo/jdmerge.c',
90 '../third_party/externals/libjpeg-turbo/jdphuff.c',
91 '../third_party/externals/libjpeg-turbo/jdpostct.c',
92 '../third_party/externals/libjpeg-turbo/jdsample.c',
93 '../third_party/externals/libjpeg-turbo/jerror.c',
94 '../third_party/externals/libjpeg-turbo/jerror.h',
95 '../third_party/externals/libjpeg-turbo/jfdctflt.c',
96 '../third_party/externals/libjpeg-turbo/jfdctfst.c',
97 '../third_party/externals/libjpeg-turbo/jfdctint.c',
98 '../third_party/externals/libjpeg-turbo/jidctflt.c',
99 '../third_party/externals/libjpeg-turbo/jidctfst.c',
100 '../third_party/externals/libjpeg-turbo/jidctint.c',
101 '../third_party/externals/libjpeg-turbo/jidctred.c',
102 '../third_party/externals/libjpeg-turbo/jinclude.h',
103 '../third_party/externals/libjpeg-turbo/jmemmgr.c',
104 '../third_party/externals/libjpeg-turbo/jmemnobs.c',
105 '../third_party/externals/libjpeg-turbo/jmemsys.h',
106 '../third_party/externals/libjpeg-turbo/jmorecfg.h',
107 '../third_party/externals/libjpeg-turbo/jpegint.h',
108 '../third_party/externals/libjpeg-turbo/jpeglib.h',
109 '../third_party/externals/libjpeg-turbo/jpeglibmangler.h',
110 '../third_party/externals/libjpeg-turbo/jquant1.c',
111 '../third_party/externals/libjpeg-turbo/jquant2.c',
112 '../third_party/externals/libjpeg-turbo/jutils.c',
113 '../third_party/externals/libjpeg-turbo/jversion.h',
114 ],
115 'direct_dependent_settings': {
116 'include_dirs': [
117 '../third_party/externals/libjpeg-turbo/',
118 ],
119 },
120 'msvs_disabled_warnings': [4018, 4101],
121 # VS2010 does not correctly incrementally link obj files generated
122 # from asm files. This flag disables UseLibraryDependencyInputs to
123 # avoid this problem.
124 'msvs_2010_disable_uldi_when_referenced': 1,
msarett72394ef2015-07-09 07:55:01 -0700125
msarett1c8a5872015-07-07 08:50:01 -0700126 # Add target-specific source files.
127 'conditions': [
msarett72394ef2015-07-09 07:55:01 -0700128 # FIXME (msarett): Reenable yasm on Android for x86 and x86_64
129 # https://code.google.com/p/skia/issues/detail?id=4028
130 [ 'skia_os == "android" and "x86" in skia_arch_type', {
131 'sources': [
132 '../third_party/externals/libjpeg-turbo/jsimd_none.c',
133 ],
134 }],
135 [ 'skia_arch_type == "x86" and skia_os != "android"', {
msarett1c8a5872015-07-07 08:50:01 -0700136 'sources': [
137 '../third_party/externals/libjpeg-turbo/simd/jsimd_i386.c',
138 '../third_party/externals/libjpeg-turbo/simd/jccolor-mmx.asm',
139 '../third_party/externals/libjpeg-turbo/simd/jccolor-sse2.asm',
140 '../third_party/externals/libjpeg-turbo/simd/jcgray-mmx.asm',
141 '../third_party/externals/libjpeg-turbo/simd/jcgray-sse2.asm',
142 '../third_party/externals/libjpeg-turbo/simd/jcsample-mmx.asm',
143 '../third_party/externals/libjpeg-turbo/simd/jcsample-sse2.asm',
144 '../third_party/externals/libjpeg-turbo/simd/jdcolor-mmx.asm',
145 '../third_party/externals/libjpeg-turbo/simd/jdcolor-sse2.asm',
146 '../third_party/externals/libjpeg-turbo/simd/jdmerge-mmx.asm',
147 '../third_party/externals/libjpeg-turbo/simd/jdmerge-sse2.asm',
148 '../third_party/externals/libjpeg-turbo/simd/jdsample-mmx.asm',
149 '../third_party/externals/libjpeg-turbo/simd/jdsample-sse2.asm',
150 '../third_party/externals/libjpeg-turbo/simd/jfdctflt-3dn.asm',
151 '../third_party/externals/libjpeg-turbo/simd/jfdctflt-sse.asm',
152 '../third_party/externals/libjpeg-turbo/simd/jfdctfst-mmx.asm',
153 '../third_party/externals/libjpeg-turbo/simd/jfdctfst-sse2.asm',
154 '../third_party/externals/libjpeg-turbo/simd/jfdctint-mmx.asm',
155 '../third_party/externals/libjpeg-turbo/simd/jfdctint-sse2.asm',
156 '../third_party/externals/libjpeg-turbo/simd/jidctflt-3dn.asm',
157 '../third_party/externals/libjpeg-turbo/simd/jidctflt-sse2.asm',
158 '../third_party/externals/libjpeg-turbo/simd/jidctflt-sse.asm',
159 '../third_party/externals/libjpeg-turbo/simd/jidctfst-mmx.asm',
160 '../third_party/externals/libjpeg-turbo/simd/jidctfst-sse2.asm',
161 '../third_party/externals/libjpeg-turbo/simd/jidctint-mmx.asm',
162 '../third_party/externals/libjpeg-turbo/simd/jidctint-sse2.asm',
163 '../third_party/externals/libjpeg-turbo/simd/jidctred-mmx.asm',
164 '../third_party/externals/libjpeg-turbo/simd/jidctred-sse2.asm',
165 '../third_party/externals/libjpeg-turbo/simd/jquant-3dn.asm',
166 '../third_party/externals/libjpeg-turbo/simd/jquantf-sse2.asm',
167 '../third_party/externals/libjpeg-turbo/simd/jquanti-sse2.asm',
168 '../third_party/externals/libjpeg-turbo/simd/jquant-mmx.asm',
169 '../third_party/externals/libjpeg-turbo/simd/jquant-sse.asm',
170 '../third_party/externals/libjpeg-turbo/simd/jsimdcpu.asm',
171 ],
172 }],
msarett72394ef2015-07-09 07:55:01 -0700173 [ 'skia_arch_type == "x86_64" and skia_os != "android"', {
msarett1c8a5872015-07-07 08:50:01 -0700174 'sources': [
175 '../third_party/externals/libjpeg-turbo/simd/jsimd_x86_64.c',
176 '../third_party/externals/libjpeg-turbo/simd/jccolor-sse2-64.asm',
177 '../third_party/externals/libjpeg-turbo/simd/jcgray-sse2-64.asm',
178 '../third_party/externals/libjpeg-turbo/simd/jcsample-sse2-64.asm',
179 '../third_party/externals/libjpeg-turbo/simd/jdcolor-sse2-64.asm',
180 '../third_party/externals/libjpeg-turbo/simd/jdmerge-sse2-64.asm',
181 '../third_party/externals/libjpeg-turbo/simd/jdsample-sse2-64.asm',
182 '../third_party/externals/libjpeg-turbo/simd/jfdctflt-sse-64.asm',
183 '../third_party/externals/libjpeg-turbo/simd/jfdctfst-sse2-64.asm',
184 '../third_party/externals/libjpeg-turbo/simd/jfdctint-sse2-64.asm',
185 '../third_party/externals/libjpeg-turbo/simd/jidctflt-sse2-64.asm',
186 '../third_party/externals/libjpeg-turbo/simd/jidctfst-sse2-64.asm',
187 '../third_party/externals/libjpeg-turbo/simd/jidctint-sse2-64.asm',
188 '../third_party/externals/libjpeg-turbo/simd/jidctred-sse2-64.asm',
189 '../third_party/externals/libjpeg-turbo/simd/jquantf-sse2-64.asm',
190 '../third_party/externals/libjpeg-turbo/simd/jquanti-sse2-64.asm',
191 ],
192 }],
193 [ 'skia_arch_type == "arm64"', {
194 'sources': [
195 '../third_party/externals/libjpeg-turbo/simd/jsimd_arm64.c',
196 '../third_party/externals/libjpeg-turbo/simd/jsimd_arm64_neon.S',
197 ],
198 }],
199 [ 'skia_arch_type == "arm"', {
200 'conditions': [
201 [ 'arm_version >= 7 and (arm_neon == 1 or arm_neon_optional == 1)', {
202 'sources': [
203 '../third_party/externals/libjpeg-turbo/simd/jsimd_arm.c',
204 '../third_party/externals/libjpeg-turbo/simd/jsimd_arm_neon.S',
205 ],
206 }, {
207 'sources': [
208 '../third_party/externals/libjpeg-turbo/jsimd_none.c',
209 ],
210 }],
211 ],
212 }],
213 [ 'skia_arch_type == "mips"', {
214 'conditions': [
215 [ 'skia_arch_width == 64', {
216 'sources': [
217 '../third_party/externals/libjpeg-turbo/simd/jsimd_mips.c',
218 '../third_party/externals/libjpeg-turbo/simd/jsimd_mips_dspr2_asm.h',
219 '../third_party/externals/libjpeg-turbo/simd/jsimd_mips_dspr2.S',
220 ],
221 }, {
222 'sources': [
223 '../third_party/externals/libjpeg-turbo/jsimd_none.c',
224 ],
225 }],
226 ],
227 }],
228
229 # Build rules for an asm file.
230 # On Windows, we use the precompiled yasm binary.
msarett718e41d2015-07-10 10:59:47 -0700231 # On Linux, we build our patched yasm and use it.
msarett1c8a5872015-07-07 08:50:01 -0700232 # On Mac, we always build our patched yasm and use it.
233 [ 'skia_os == "win"', {
msarett718e41d2015-07-10 10:59:47 -0700234 'dependencies': [
235 'yasm-win',
236 ],
msarett1c8a5872015-07-07 08:50:01 -0700237 'variables': {
msarett718e41d2015-07-10 10:59:47 -0700238 'yasm_path': '<(PRODUCT_DIR)/yasm.exe',
msarett1c8a5872015-07-07 08:50:01 -0700239 'conditions': [
240 [ 'skia_arch_type == "x86"', {
241 'yasm_format': '-fwin32',
242 'yasm_flags': [
243 '-D__x86__',
244 '-DWIN32',
245 '-DMSVC',
246 '-Iwin/'
247 ],
248 }, {
249 'yasm_format': '-fwin64',
250 'yasm_flags': [
251 '-D__x86_64__',
252 '-DWIN64',
253 '-DMSVC',
254 '-Iwin/'
255 ],
256 }],
257 ],
258 },
259 }],
260 [ 'skia_os == "android" and (skia_arch_type == "x86" or skia_arch_type == "x86_64")', {
261 'variables': {
262 'yasm_path': '../third_party/yasm/config/android/yasm',
263 'conditions': [
264 [ 'skia_arch_type == "x86"', {
265 'yasm_format': '-felf',
266 'yasm_flags': [
267 '-D__x86__',
268 '-DELF',
269 '-Ilinux/'
270 ],
271 }, {
272 'yasm_format': '-felf64',
273 'yasm_flags': [
274 '-D__x86_64__',
275 '-DELF',
276 '-Ilinux/'
277 ],
278 }],
279 ],
280 },
281 }],
282 [ '(skia_os == "mac" or skia_os == "ios") and \
283 (skia_arch_type == "x86" or skia_arch_type == "x86_64")', {
284 'dependencies': [
285 'yasm.gyp:yasm#host',
286 ],
287 'variables': {
288 'yasm_path': '<(PRODUCT_DIR)/yasm',
289 'conditions': [
290 [ 'skia_arch_type == "x86"', {
291 'yasm_format': '-fmacho',
292 'yasm_flags': [
293 '-D__x86__',
294 '-DMACHO',
295 '-Imac/'
296 ],
297 }, {
298 'yasm_format': '-fmacho64',
299 'yasm_flags': [
300 '-D__x86_64__',
301 '-DMACHO',
302 '-Imac/'
303 ],
304 }],
305 ],
306 },
307 }],
308 [ '(skia_os == "linux" or skia_os == "freebsd" or skia_os == "openbsd" or \
309 skia_os == "solaris" or skia_os == "chromeos")', {
310 'dependencies': [
311 'yasm.gyp:yasm#host',
312 ],
313 'variables': {
314 'yasm_path': '<(PRODUCT_DIR)/yasm',
315 'conditions': [
316 [ 'skia_arch_type == "x86"', {
317 'yasm_format': '-felf',
318 'yasm_flags': [
319 '-D__x86__',
320 '-DELF',
321 '-Ilinux/'
322 ],
323 }, {
324 'yasm_format': '-felf64',
325 'yasm_flags': [
326 '-D__x86_64__',
327 '-DELF',
328 '-Ilinux/'
329 ],
330 }],
331 ],
332 },
333 }],
334 ],
335 'rules': [
336 {
337 'rule_name': 'assemble',
338 'extension': 'asm',
339 'conditions': [
340 [ 'skia_arch_type == "x86" or skia_arch_type == "x86_64"', {
341 'inputs': [],
342 'outputs': [
343 '<(shared_generated_dir)/<(RULE_INPUT_ROOT).<(object_suffix)',
344 ],
345 'action': [
346 '<(yasm_path)',
347 '<(yasm_format)',
348 '<@(yasm_flags)',
349 '-DRGBX_FILLER_0XFF',
350 '-DSTRICT_MEMORY_ACCESS',
351 '-Isimd/',
352 '-o', '<(shared_generated_dir)/<(RULE_INPUT_ROOT).<(object_suffix)',
353 '<(RULE_INPUT_PATH)',
354 ],
355 'process_outputs_as_sources': 1,
356 'message': 'Building <(RULE_INPUT_ROOT).<(object_suffix)',
357 }],
358 ]
359 },
360 ],
361 },
362 ],
363}