• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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  'variables': {
7    'skia_warnings_as_errors': 0,
8    'conditions':[
9      ['skia_android_framework == 1', {
10        'use_system_libwebp': 1,
11      }, {
12        'use_system_libwebp%': 0,
13      }],
14    ],
15  },
16  'conditions': [
17    ['use_system_libwebp==0', {
18      'targets': [
19        {
20          'target_name': 'libwebp_dec',
21          'type': 'static_library',
22          'includes': [
23            'libwebp_skia.gypi',
24          ],
25          'include_dirs': [
26              '../third_party/externals/libwebp',
27          ],
28          'sources': [
29            '../third_party/externals/libwebp/src/dec/alpha.c',
30            '../third_party/externals/libwebp/src/dec/buffer.c',
31            '../third_party/externals/libwebp/src/dec/frame.c',
32            '../third_party/externals/libwebp/src/dec/idec.c',
33            '../third_party/externals/libwebp/src/dec/io.c',
34            '../third_party/externals/libwebp/src/dec/quant.c',
35            '../third_party/externals/libwebp/src/dec/tree.c',
36            '../third_party/externals/libwebp/src/dec/vp8.c',
37            '../third_party/externals/libwebp/src/dec/vp8l.c',
38            '../third_party/externals/libwebp/src/dec/webp.c',
39          ],
40          'cflags': [ '-w' ],
41          'xcode_settings': { 'WARNING_CFLAGS': [ '-w' ] },
42        },
43        {
44          'target_name': 'libwebp_demux',
45          'type': 'static_library',
46          'includes': [
47            'libwebp_skia.gypi',
48          ],
49          'include_dirs': [
50              '../third_party/externals/libwebp',
51          ],
52          'sources': [
53            '../third_party/externals/libwebp/src/demux/demux.c',
54          ],
55          'cflags': [ '-w' ],
56          'xcode_settings': { 'WARNING_CFLAGS': [ '-w' ] },
57        },
58        {
59          'target_name': 'libwebp_dsp',
60          'type': 'static_library',
61          'includes': [
62            'libwebp_skia.gypi',
63          ],
64          'include_dirs': [
65              '../third_party/externals/libwebp',
66          ],
67          'sources': [
68            '../third_party/externals/libwebp/src/dsp/alpha_processing.c',
69            '../third_party/externals/libwebp/src/dsp/alpha_processing_mips_dsp_r2.c',
70            '../third_party/externals/libwebp/src/dsp/alpha_processing_sse2.c',
71            '../third_party/externals/libwebp/src/dsp/alpha_processing_sse41.c',
72            '../third_party/externals/libwebp/src/dsp/cpu.c',
73            '../third_party/externals/libwebp/src/dsp/dec.c',
74            '../third_party/externals/libwebp/src/dsp/dec_clip_tables.c',
75            '../third_party/externals/libwebp/src/dsp/dec_mips32.c',
76            '../third_party/externals/libwebp/src/dsp/dec_mips_dsp_r2.c',
77            '../third_party/externals/libwebp/src/dsp/dec_sse2.c',
78            '../third_party/externals/libwebp/src/dsp/dec_sse41.c',
79            '../third_party/externals/libwebp/src/dsp/enc.c',
80            '../third_party/externals/libwebp/src/dsp/enc_sse2.c',
81            '../third_party/externals/libwebp/src/dsp/filters.c',
82            '../third_party/externals/libwebp/src/dsp/filters_mips_dsp_r2.c',
83            '../third_party/externals/libwebp/src/dsp/filters_sse2.c',
84            '../third_party/externals/libwebp/src/dsp/lossless.c',
85            '../third_party/externals/libwebp/src/dsp/lossless_mips_dsp_r2.c',
86            '../third_party/externals/libwebp/src/dsp/lossless_sse2.c',
87            '../third_party/externals/libwebp/src/dsp/rescaler.c',
88            '../third_party/externals/libwebp/src/dsp/rescaler_mips32.c',
89            '../third_party/externals/libwebp/src/dsp/rescaler_mips_dsp_r2.c',
90            '../third_party/externals/libwebp/src/dsp/rescaler_sse2.c',
91            '../third_party/externals/libwebp/src/dsp/upsampling.c',
92            '../third_party/externals/libwebp/src/dsp/upsampling_mips_dsp_r2.c',
93            '../third_party/externals/libwebp/src/dsp/upsampling_sse2.c',
94            '../third_party/externals/libwebp/src/dsp/yuv.c',
95            '../third_party/externals/libwebp/src/dsp/yuv_mips32.c',
96            '../third_party/externals/libwebp/src/dsp/yuv_mips_dsp_r2.c',
97            '../third_party/externals/libwebp/src/dsp/yuv_sse2.c',
98          ],
99          'cflags': [ '-w' ],
100          'xcode_settings': { 'WARNING_CFLAGS': [ '-w' ] },
101          'conditions': [
102            ['skia_os == "android"', {
103              'dependencies' : [
104                'android_deps.gyp:cpu_features',
105              ],
106            }],
107          ],
108        },
109        {
110          'target_name': 'libwebp_dsp_neon',
111          'includes': [
112            'libwebp_skia.gypi',
113          ],
114          'conditions': [
115            ['arm_version == 7', {
116              'cflags': [ '-mfpu=neon' ],
117            }],
118            ['arm_version >= 7', {
119              'type': 'static_library',
120              'include_dirs': [
121                  '../third_party/externals/libwebp',
122              ],
123              'sources': [
124                '../third_party/externals/libwebp/src/dsp/dec_neon.c',
125                '../third_party/externals/libwebp/src/dsp/enc_neon.c',
126                '../third_party/externals/libwebp/src/dsp/lossless_neon.c',
127                '../third_party/externals/libwebp/src/dsp/lossless_enc_neon.c',
128                '../third_party/externals/libwebp/src/dsp/rescaler_neon.c',
129                '../third_party/externals/libwebp/src/dsp/upsampling_neon.c',
130              ],
131              # behavior similar dsp_neon.c.neon in an Android.mk
132              'cflags!': [
133                '-mfpu=vfpv3-d16',
134              ],
135              'cflags': [ '-w' ],
136            },{  # !(arm_version >= 7)
137              'type': 'none',
138            }],
139          ],
140        },
141        {
142          'target_name': 'libwebp_dsp_enc',
143          'type': 'static_library',
144          'includes': [
145            'libwebp_skia.gypi',
146          ],
147          'include_dirs': [
148              '../third_party/externals/libwebp',
149          ],
150          'sources': [
151            '../third_party/externals/libwebp/src/dsp/argb.c',
152            '../third_party/externals/libwebp/src/dsp/argb_mips_dsp_r2.c',
153            '../third_party/externals/libwebp/src/dsp/argb_sse2.c',
154            '../third_party/externals/libwebp/src/dsp/cost.c',
155            '../third_party/externals/libwebp/src/dsp/cost_mips32.c',
156            '../third_party/externals/libwebp/src/dsp/cost_mips_dsp_r2.c',
157            '../third_party/externals/libwebp/src/dsp/cost_sse2.c',
158            '../third_party/externals/libwebp/src/dsp/enc_avx2.c',
159            '../third_party/externals/libwebp/src/dsp/enc_mips32.c',
160            '../third_party/externals/libwebp/src/dsp/enc_mips_dsp_r2.c',
161            '../third_party/externals/libwebp/src/dsp/enc_sse41.c',
162            '../third_party/externals/libwebp/src/dsp/lossless_enc.c',
163            '../third_party/externals/libwebp/src/dsp/lossless_enc_mips32.c',
164            '../third_party/externals/libwebp/src/dsp/lossless_enc_mips_dsp_r2.c',
165            '../third_party/externals/libwebp/src/dsp/lossless_enc_sse2.c',
166            '../third_party/externals/libwebp/src/dsp/lossless_enc_sse41.c',
167          ],
168        },
169        {
170          'target_name': 'libwebp_enc',
171          'type': 'static_library',
172          'includes': [
173            'libwebp_skia.gypi',
174          ],
175          'include_dirs': [
176              '../third_party/externals/libwebp',
177          ],
178          'dependencies' : [
179            'libwebp_dsp_enc',
180          ],
181          'sources': [
182            '../third_party/externals/libwebp/src/enc/alpha.c',
183            '../third_party/externals/libwebp/src/enc/analysis.c',
184            '../third_party/externals/libwebp/src/enc/backward_references.c',
185            '../third_party/externals/libwebp/src/enc/config.c',
186            '../third_party/externals/libwebp/src/enc/cost.c',
187            '../third_party/externals/libwebp/src/enc/filter.c',
188            '../third_party/externals/libwebp/src/enc/frame.c',
189            '../third_party/externals/libwebp/src/enc/histogram.c',
190            '../third_party/externals/libwebp/src/enc/iterator.c',
191            '../third_party/externals/libwebp/src/enc/near_lossless.c',
192            '../third_party/externals/libwebp/src/enc/picture.c',
193            '../third_party/externals/libwebp/src/enc/picture_csp.c',
194            '../third_party/externals/libwebp/src/enc/picture_psnr.c',
195            '../third_party/externals/libwebp/src/enc/picture_rescale.c',
196            '../third_party/externals/libwebp/src/enc/picture_tools.c',
197            '../third_party/externals/libwebp/src/enc/quant.c',
198            '../third_party/externals/libwebp/src/enc/syntax.c',
199            '../third_party/externals/libwebp/src/enc/token.c',
200            '../third_party/externals/libwebp/src/enc/tree.c',
201            '../third_party/externals/libwebp/src/enc/vp8l.c',
202            '../third_party/externals/libwebp/src/enc/webpenc.c',
203          ],
204          'cflags': [ '-w' ],
205          'xcode_settings': { 'WARNING_CFLAGS': [ '-w' ] },
206        },
207        {
208          'target_name': 'libwebp_utils',
209          'type': 'static_library',
210          'includes': [
211            'libwebp_skia.gypi',
212          ],
213          'include_dirs': [
214              '../third_party/externals/libwebp',
215          ],
216          'sources': [
217            '../third_party/externals/libwebp/src/utils/bit_reader.c',
218            '../third_party/externals/libwebp/src/utils/bit_writer.c',
219            '../third_party/externals/libwebp/src/utils/color_cache.c',
220            '../third_party/externals/libwebp/src/utils/filters.c',
221            '../third_party/externals/libwebp/src/utils/huffman.c',
222            '../third_party/externals/libwebp/src/utils/huffman_encode.c',
223            '../third_party/externals/libwebp/src/utils/quant_levels.c',
224            '../third_party/externals/libwebp/src/utils/quant_levels_dec.c',
225            '../third_party/externals/libwebp/src/utils/random.c',
226            '../third_party/externals/libwebp/src/utils/rescaler.c',
227            '../third_party/externals/libwebp/src/utils/thread.c',
228            '../third_party/externals/libwebp/src/utils/utils.c',
229          ],
230          'cflags': [ '-w' ],
231          'xcode_settings': { 'WARNING_CFLAGS': [ '-w' ] },
232        },
233        {
234          'target_name': 'libwebp',
235          'type': 'none',
236          'dependencies' : [
237            'libwebp_dec',
238            'libwebp_demux',
239            'libwebp_dsp',
240            'libwebp_dsp_neon',
241            'libwebp_enc',
242            'libwebp_utils',
243          ],
244          'direct_dependent_settings': {
245            'include_dirs': [
246              '../third_party/externals/libwebp/src',
247            ],
248          },
249          'conditions': [
250            ['OS!="win"', {'product_name': 'webp'}],
251          ],
252        },
253      ],
254    }, {
255      # use_system_libwebp == 1
256      'targets': [
257        {
258          'target_name': 'libwebp',
259          'type': 'none',
260          'conditions': [
261            [ 'skia_android_framework', {
262              'direct_dependent_settings': {
263                'libraries': [
264                  'libwebp-decode.a',
265                  'libwebp-encode.a',
266                ],
267              'include_dirs': [
268                'external/webp/include',
269              ],
270              },
271            }, { # skia_android_framework == 0
272              'direct_dependent_settings': {
273                'defines': [
274                  'ENABLE_WEBP',
275                ],
276                },
277                'link_settings': {
278                  'libraries': [
279                    '-lwebp',
280                  ],
281                },
282              },
283            ],
284          ],
285        }
286      ],
287    }],
288  ],
289}
290