Blink roll 25b6bd3a7a131ffe68d809546ad1a20707915cdc:3a503f41ae42e5b79cfcd2ff10e65afde...
[chromium-blink-merge.git] / third_party / libwebp / libwebp.gyp
blob01c651047f77140911b0a84236a11cb9c8d18e8a
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.
6   'variables': {
7     'neon_sources': [
8       'dsp/dec_neon.c',
9       'dsp/enc_neon.c',
10       'dsp/lossless_neon.c',
11       'dsp/upsampling_neon.c',
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     },
45     {
46       'target_name': 'libwebp_dsp',
47       'type': 'static_library',
48       'include_dirs': ['.'],
49       'sources': [
50         'dsp/alpha_processing.c',
51         'dsp/alpha_processing_sse2.c',
52         'dsp/cpu.c',
53         'dsp/dec.c',
54         'dsp/dec_clip_tables.c',
55         'dsp/dec_mips32.c',
56         'dsp/dec_sse2.c',
57         'dsp/enc.c',
58         'dsp/enc_avx2.c',
59         'dsp/enc_mips32.c',
60         'dsp/enc_sse2.c',
61         'dsp/lossless.c',
62         'dsp/lossless_mips32.c',
63         'dsp/lossless_sse2.c',
64         'dsp/upsampling.c',
65         'dsp/upsampling_sse2.c',
66         'dsp/yuv.c',
67         'dsp/yuv_mips32.c',
68         'dsp/yuv_sse2.c',
69       ],
70       'conditions': [
71         ['OS == "android"', {
72           'includes': [ '../../build/android/cpufeatures.gypi' ],
73         }],
74         ['order_profiling != 0', {
75           'target_conditions' : [
76             ['_toolset=="target"', {
77               'cflags!': [ '-finstrument-functions' ],
78             }],
79           ],
80         }],
81       ],
82     },
83     {
84       'target_name': 'libwebp_dsp_neon',
85       'conditions': [
86         ['target_arch == "arm" and arm_version >= 7 and (arm_neon == 1 or arm_neon_optional == 1)', {
87           'type': 'static_library',
88           'include_dirs': ['.'],
89           'sources': [
90             '<@(neon_sources)'
91           ],
92           # behavior similar to *.c.neon in an Android.mk
93           'cflags!': [ '-mfpu=vfpv3-d16' ],
94           'cflags': [ '-mfpu=neon' ],
95         },{
96           'conditions': [
97             ['target_arch == "arm64"', {
98               'type': 'static_library',
99               'include_dirs': ['.'],
100               'sources': [
101                 '<@(neon_sources)'
102               ],
103               # avoid an ICE with gcc-4.9: b/15574841
104               'cflags': [ '-frename-registers' ],
105             },{  # "target_arch != "arm|arm64" or arm_version < 7"
106               'type': 'none',
107             }],
108           ],
109         }],
110         ['order_profiling != 0', {
111           'target_conditions' : [
112             ['_toolset=="target"', {
113               'cflags!': [ '-finstrument-functions' ],
114             }],
115           ],
116         }],
117       ],
118     },
119     {
120       'target_name': 'libwebp_enc',
121       'type': 'static_library',
122       'include_dirs': ['.'],
123       'sources': [
124         'enc/alpha.c',
125         'enc/analysis.c',
126         'enc/backward_references.c',
127         'enc/config.c',
128         'enc/cost.c',
129         'enc/filter.c',
130         'enc/frame.c',
131         'enc/histogram.c',
132         'enc/iterator.c',
133         'enc/picture.c',
134         'enc/picture_csp.c',
135         'enc/picture_psnr.c',
136         'enc/picture_rescale.c',
137         'enc/picture_tools.c',
138         'enc/quant.c',
139         'enc/syntax.c',
140         'enc/token.c',
141         'enc/tree.c',
142         'enc/vp8l.c',
143         'enc/webpenc.c',
144       ],
145     },
146     {
147       'target_name': 'libwebp_utils',
148       'type': 'static_library',
149       'include_dirs': ['.'],
150       'sources': [
151         'utils/bit_reader.c',
152         'utils/bit_writer.c',
153         'utils/color_cache.c',
154         'utils/filters.c',
155         'utils/huffman.c',
156         'utils/huffman_encode.c',
157         'utils/quant_levels.c',
158         'utils/quant_levels_dec.c',
159         'utils/random.c',
160         'utils/rescaler.c',
161         'utils/thread.c',
162         'utils/utils.c',
163       ],
164     },
165     {
166       'target_name': 'libwebp',
167       'type': 'none',
168       'dependencies' : [
169         'libwebp_dec',
170         'libwebp_demux',
171         'libwebp_dsp',
172         'libwebp_dsp_neon',
173         'libwebp_enc',
174         'libwebp_utils',
175       ],
176       'direct_dependent_settings': {
177         'include_dirs': ['.'],
178       },
179       'conditions': [
180         ['OS!="win"', {'product_name': 'webp'}],
181       ],
182     },
183   ],