OLD | NEW |
| (Empty) |
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 | |
3 # found in the LICENSE file. | |
4 | |
5 { | |
6 'target_defaults': { | |
7 'conditions': [ | |
8 ['os_posix==1 and (target_arch=="arm" or target_arch=="arm64")', { | |
9 'cflags!': [ '-Os' ], | |
10 'cflags': [ '-O2' ], | |
11 }], | |
12 ], | |
13 }, | |
14 'targets': [ | |
15 { | |
16 'target_name': 'libwebp_dec', | |
17 'type': 'static_library', | |
18 'dependencies' : [ | |
19 'libwebp_dsp', | |
20 'libwebp_dsp_neon', | |
21 'libwebp_utils', | |
22 ], | |
23 'include_dirs': ['.'], | |
24 'sources': [ | |
25 'dec/alpha.c', | |
26 'dec/buffer.c', | |
27 'dec/frame.c', | |
28 'dec/idec.c', | |
29 'dec/io.c', | |
30 'dec/quant.c', | |
31 'dec/tree.c', | |
32 'dec/vp8.c', | |
33 'dec/vp8l.c', | |
34 'dec/webp.c', | |
35 ], | |
36 }, | |
37 { | |
38 'target_name': 'libwebp_demux', | |
39 'type': 'static_library', | |
40 'include_dirs': ['.'], | |
41 'sources': [ | |
42 'demux/demux.c', | |
43 ], | |
44 'dependencies' : [ | |
45 'libwebp_utils', | |
46 ], | |
47 }, | |
48 { | |
49 'target_name': 'libwebp_dsp', | |
50 'type': 'static_library', | |
51 'include_dirs': ['.'], | |
52 'sources': [ | |
53 'dsp/alpha_processing.c', | |
54 'dsp/alpha_processing_mips_dsp_r2.c', | |
55 'dsp/argb.c', | |
56 'dsp/argb_mips_dsp_r2.c', | |
57 'dsp/cost.c', | |
58 'dsp/cost_mips32.c', | |
59 'dsp/cost_mips_dsp_r2.c', | |
60 'dsp/cpu.c', | |
61 'dsp/dec.c', | |
62 'dsp/dec_clip_tables.c', | |
63 'dsp/dec_mips32.c', | |
64 'dsp/dec_mips_dsp_r2.c', | |
65 'dsp/dec_msa.c', | |
66 'dsp/enc.c', | |
67 'dsp/enc_avx2.c', | |
68 'dsp/enc_mips32.c', | |
69 'dsp/enc_mips_dsp_r2.c', | |
70 'dsp/filters.c', | |
71 'dsp/filters_mips_dsp_r2.c', | |
72 'dsp/lossless.c', | |
73 'dsp/lossless_enc.c', | |
74 'dsp/lossless_enc_mips32.c', | |
75 'dsp/lossless_enc_mips_dsp_r2.c', | |
76 'dsp/lossless_mips_dsp_r2.c', | |
77 'dsp/rescaler.c', | |
78 'dsp/rescaler_mips32.c', | |
79 'dsp/rescaler_mips_dsp_r2.c', | |
80 'dsp/upsampling.c', | |
81 'dsp/upsampling_mips_dsp_r2.c', | |
82 'dsp/yuv.c', | |
83 'dsp/yuv_mips32.c', | |
84 'dsp/yuv_mips_dsp_r2.c', | |
85 ], | |
86 'dependencies' : [ | |
87 'libwebp_dsp_sse2', | |
88 'libwebp_dsp_sse41', | |
89 'libwebp_utils', | |
90 ], | |
91 'conditions': [ | |
92 ['OS == "android"', { | |
93 'dependencies': [ '../../build/android/ndk.gyp:cpu_features' ], | |
94 }], | |
95 # iOS uses the same project to generate build project for both device | |
96 # and simulator and do not use "target_arch" variable. Other platform | |
97 # set it correctly. | |
98 ['OS!="ios" and (target_arch=="ia32" or target_arch=="x64")', { | |
99 'defines': [ 'WEBP_HAVE_SSE2', 'WEBP_HAVE_SSE41' ], | |
100 }], | |
101 ], | |
102 }, | |
103 { | |
104 'target_name': 'libwebp_dsp_sse2', | |
105 'type': 'static_library', | |
106 'include_dirs': ['.'], | |
107 'sources': [ | |
108 'dsp/alpha_processing_sse2.c', | |
109 'dsp/argb_sse2.c', | |
110 'dsp/cost_sse2.c', | |
111 'dsp/dec_sse2.c', | |
112 'dsp/enc_sse2.c', | |
113 'dsp/filters_sse2.c', | |
114 'dsp/lossless_enc_sse2.c', | |
115 'dsp/lossless_sse2.c', | |
116 'dsp/rescaler_sse2.c', | |
117 'dsp/upsampling_sse2.c', | |
118 'dsp/yuv_sse2.c', | |
119 ], | |
120 'conditions': [ | |
121 # iOS uses the same project to generate build project for both device | |
122 # and simulator and do not use "target_arch" variable. Other platform | |
123 # set it correctly. | |
124 ['OS!="ios" and (target_arch=="ia32" or target_arch=="x64") and msan==0'
, { | |
125 'cflags': [ '-msse2', ], | |
126 'xcode_settings': { 'OTHER_CFLAGS': [ '-msse2' ] }, | |
127 }], | |
128 ], | |
129 }, | |
130 { | |
131 'target_name': 'libwebp_dsp_sse41', | |
132 'type': 'static_library', | |
133 'include_dirs': ['.'], | |
134 'sources': [ | |
135 'dsp/alpha_processing_sse41.c', | |
136 'dsp/dec_sse41.c', | |
137 'dsp/enc_sse41.c', | |
138 'dsp/lossless_enc_sse41.c', | |
139 ], | |
140 'conditions': [ | |
141 ['OS=="win" and clang==1', { | |
142 # cl.exe's /arch flag doesn't have a setting for SSSE3/4, and cl.exe | |
143 # doesn't need it for intrinsics. clang-cl does need it, though. | |
144 'msvs_settings': { | |
145 'VCCLCompilerTool': { 'AdditionalOptions': [ '-msse4.1' ] }, | |
146 }, | |
147 }], | |
148 # iOS uses the same project to generate build project for both device | |
149 # and simulator and do not use "target_arch" variable. Other platform | |
150 # set it correctly. | |
151 ['OS!="ios" and (target_arch=="ia32" or target_arch=="x64") and msan==0'
, { | |
152 'cflags': [ '-msse4.1', ], | |
153 'xcode_settings': { 'OTHER_CFLAGS': [ '-msse4.1' ] }, | |
154 }], | |
155 ], | |
156 }, | |
157 { | |
158 'target_name': 'libwebp_dsp_neon', | |
159 'includes' : [ | |
160 # Disable LTO due to Neon issues. | |
161 # crbug.com/408997 | |
162 '../../build/android/disable_gcc_lto.gypi', | |
163 ], | |
164 'conditions': [ | |
165 # iOS uses the same project to generate build project for both device | |
166 # and simulator and do not use "target_arch" variable. Other platform | |
167 # set it correctly. | |
168 ['OS == "ios" or (target_arch == "arm" and arm_version >= 7 and (arm_neo
n == 1 or arm_neon_optional == 1)) or (target_arch == "arm64")', { | |
169 'type': 'static_library', | |
170 'include_dirs': ['.'], | |
171 'sources': [ | |
172 'dsp/dec_neon.c', | |
173 'dsp/enc_neon.c', | |
174 'dsp/lossless_enc_neon.c', | |
175 'dsp/lossless_neon.c', | |
176 'dsp/rescaler_neon.c', | |
177 'dsp/upsampling_neon.c', | |
178 ], | |
179 'conditions': [ | |
180 ['target_arch == "arm" and arm_version >= 7 and (arm_neon == 1 or ar
m_neon_optional == 1)', { | |
181 # behavior similar to *.c.neon in an Android.mk | |
182 'cflags!': [ '-mfpu=vfpv3-d16' ], | |
183 'cflags': [ '-mfpu=neon' ], | |
184 }], | |
185 ['target_arch == "arm64" and clang != 1', { | |
186 # avoid an ICE with gcc-4.9: b/15574841 | |
187 'cflags': [ '-frename-registers' ], | |
188 }], | |
189 ] | |
190 }, { | |
191 'type': 'none', | |
192 }], | |
193 ], | |
194 }, | |
195 { | |
196 'target_name': 'libwebp_enc', | |
197 'type': 'static_library', | |
198 'include_dirs': ['.'], | |
199 'sources': [ | |
200 'enc/alpha.c', | |
201 'enc/analysis.c', | |
202 'enc/backward_references.c', | |
203 'enc/config.c', | |
204 'enc/cost.c', | |
205 'enc/delta_palettization.c', | |
206 'enc/filter.c', | |
207 'enc/frame.c', | |
208 'enc/histogram.c', | |
209 'enc/iterator.c', | |
210 'enc/near_lossless.c', | |
211 'enc/picture.c', | |
212 'enc/picture_csp.c', | |
213 'enc/picture_psnr.c', | |
214 'enc/picture_rescale.c', | |
215 'enc/picture_tools.c', | |
216 'enc/quant.c', | |
217 'enc/syntax.c', | |
218 'enc/token.c', | |
219 'enc/tree.c', | |
220 'enc/vp8l.c', | |
221 'enc/webpenc.c', | |
222 ], | |
223 'dependencies' : [ | |
224 'libwebp_utils', | |
225 ], | |
226 }, | |
227 { | |
228 'target_name': 'libwebp_utils', | |
229 'type': 'static_library', | |
230 'include_dirs': ['.'], | |
231 'sources': [ | |
232 'utils/bit_reader.c', | |
233 'utils/bit_writer.c', | |
234 'utils/color_cache.c', | |
235 'utils/filters.c', | |
236 'utils/huffman.c', | |
237 'utils/huffman_encode.c', | |
238 'utils/quant_levels.c', | |
239 'utils/quant_levels_dec.c', | |
240 'utils/random.c', | |
241 'utils/rescaler.c', | |
242 'utils/thread.c', | |
243 'utils/utils.c', | |
244 ], | |
245 'variables': { | |
246 'clang_warning_flags': [ | |
247 # See https://code.google.com/p/webp/issues/detail?id=253. | |
248 '-Wno-incompatible-pointer-types', | |
249 ] | |
250 }, | |
251 }, | |
252 { | |
253 'target_name': 'libwebp', | |
254 'type': 'none', | |
255 'dependencies' : [ | |
256 'libwebp_dec', | |
257 'libwebp_demux', | |
258 'libwebp_dsp', | |
259 'libwebp_dsp_neon', | |
260 'libwebp_enc', | |
261 'libwebp_utils', | |
262 ], | |
263 'direct_dependent_settings': { | |
264 'include_dirs': ['.'], | |
265 }, | |
266 'conditions': [ | |
267 ['OS!="win"', {'product_name': 'webp'}], | |
268 ], | |
269 }, | |
270 ], | |
271 } | |
OLD | NEW |