Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / third_party / skia / gyp / libwebp.gyp
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     'conditions':[
8       ['skia_android_framework == 1', {
9         'use_system_libwebp': 1,
10       }, {
11         'use_system_libwebp%': 0,
12       }],
13     ],
14   },
15   'conditions': [
16     ['use_system_libwebp==0', {
17       'targets': [
18         {
19           'target_name': 'libwebp_dec',
20           'type': 'static_library',
21           'include_dirs': [
22               '../third_party/externals/libwebp',
23           ],
24           'sources': [
25             '../third_party/externals/libwebp/src/dec/alpha.c',
26             '../third_party/externals/libwebp/src/dec/buffer.c',
27             '../third_party/externals/libwebp/src/dec/frame.c',
28             '../third_party/externals/libwebp/src/dec/idec.c',
29             '../third_party/externals/libwebp/src/dec/io.c',
30             '../third_party/externals/libwebp/src/dec/layer.c',
31             '../third_party/externals/libwebp/src/dec/quant.c',
32             '../third_party/externals/libwebp/src/dec/tree.c',
33             '../third_party/externals/libwebp/src/dec/vp8.c',
34             '../third_party/externals/libwebp/src/dec/vp8l.c',
35             '../third_party/externals/libwebp/src/dec/webp.c',
36           ],
37         },
38         {
39           'target_name': 'libwebp_demux',
40           'type': 'static_library',
41           'include_dirs': [
42               '../third_party/externals/libwebp',
43           ],
44           'sources': [
45             '../third_party/externals/libwebp/src/demux/demux.c',
46           ],
47         },
48         {
49           'target_name': 'libwebp_dsp',
50           'type': 'static_library',
51           'include_dirs': [
52               '../third_party/externals/libwebp',
53           ],
54           'sources': [
55             '../third_party/externals/libwebp/src/dsp/cpu.c',
56             '../third_party/externals/libwebp/src/dsp/dec.c',
57             '../third_party/externals/libwebp/src/dsp/dec_sse2.c',
58             '../third_party/externals/libwebp/src/dsp/enc.c',
59             '../third_party/externals/libwebp/src/dsp/enc_sse2.c',
60             '../third_party/externals/libwebp/src/dsp/lossless.c',
61             '../third_party/externals/libwebp/src/dsp/upsampling.c',
62             '../third_party/externals/libwebp/src/dsp/upsampling_sse2.c',
63             '../third_party/externals/libwebp/src/dsp/yuv.c',
64           ],
65           'conditions': [
66             ['skia_os == "android"', {
67               'dependencies' : [
68                 'android_deps.gyp:cpu_features',
69               ],
70             }],
71           ],
72         },
73         {
74           'target_name': 'libwebp_dsp_neon',
75           'conditions': [
76             ['arm_version >= 7', {
77               'type': 'static_library',
78               'include_dirs': [
79                   '../third_party/externals/libwebp',
80               ],
81               'sources': [
82                 '../third_party/externals/libwebp/src/dsp/dec_neon.c',
83                 '../third_party/externals/libwebp/src/dsp/enc_neon.c',
84                 '../third_party/externals/libwebp/src/dsp/upsampling_neon.c',
85               ],
86               # behavior similar dsp_neon.c.neon in an Android.mk
87               'cflags!': [
88                 '-mfpu=vfpv3-d16',
89               ],
90               'cflags': [ '-mfpu=neon' ],
91             },{  # !(arm_version >= 7)
92               'type': 'none',
93             }],
94           ],
95         },
96         {
97           'target_name': 'libwebp_enc',
98           'type': 'static_library',
99           'include_dirs': [
100               '../third_party/externals/libwebp',
101           ],
102           'sources': [
103             '../third_party/externals/libwebp/src/enc/alpha.c',
104             '../third_party/externals/libwebp/src/enc/analysis.c',
105             '../third_party/externals/libwebp/src/enc/backward_references.c',
106             '../third_party/externals/libwebp/src/enc/config.c',
107             '../third_party/externals/libwebp/src/enc/cost.c',
108             '../third_party/externals/libwebp/src/enc/filter.c',
109             '../third_party/externals/libwebp/src/enc/frame.c',
110             '../third_party/externals/libwebp/src/enc/histogram.c',
111             '../third_party/externals/libwebp/src/enc/iterator.c',
112             '../third_party/externals/libwebp/src/enc/layer.c',
113             '../third_party/externals/libwebp/src/enc/picture.c',
114             '../third_party/externals/libwebp/src/enc/quant.c',
115             '../third_party/externals/libwebp/src/enc/syntax.c',
116             '../third_party/externals/libwebp/src/enc/token.c',
117             '../third_party/externals/libwebp/src/enc/tree.c',
118             '../third_party/externals/libwebp/src/enc/vp8l.c',
119             '../third_party/externals/libwebp/src/enc/webpenc.c',
120           ],
121           'cflags': [ '-w' ],
122         },
123         {
124           'target_name': 'libwebp_utils',
125           'type': 'static_library',
126           'include_dirs': [
127               '../third_party/externals/libwebp',
128           ],
129           'sources': [
130             '../third_party/externals/libwebp/src/utils/bit_reader.c',
131             '../third_party/externals/libwebp/src/utils/bit_writer.c',
132             '../third_party/externals/libwebp/src/utils/color_cache.c',
133             '../third_party/externals/libwebp/src/utils/filters.c',
134             '../third_party/externals/libwebp/src/utils/huffman.c',
135             '../third_party/externals/libwebp/src/utils/huffman_encode.c',
136             '../third_party/externals/libwebp/src/utils/quant_levels.c',
137             '../third_party/externals/libwebp/src/utils/quant_levels_dec.c',
138             '../third_party/externals/libwebp/src/utils/rescaler.c',
139             '../third_party/externals/libwebp/src/utils/thread.c',
140             '../third_party/externals/libwebp/src/utils/utils.c',
141           ],
142         },
143         {
144           'target_name': 'libwebp',
145           'type': 'none',
146           'dependencies' : [
147             'libwebp_dec',
148             'libwebp_demux',
149             'libwebp_dsp',
150             'libwebp_dsp_neon',
151             'libwebp_enc',
152             'libwebp_utils',
153           ],
154           'direct_dependent_settings': {
155             'include_dirs': [
156               '../third_party/externals/libwebp/src',
157             ],
158           },
159           'conditions': [
160             ['OS!="win"', {'product_name': 'webp'}],
161           ],
162         },
163       ],
164     }, {
165       # use_system_libwep == 1
166       'targets': [
167         {
168           'target_name': 'libwebp',
169           'type': 'none',
170           'conditions': [
171             [ 'skia_android_framework', {
172               'direct_dependent_settings': {
173                 'libraries': [
174                   'libwebp-decode.a',
175                   'libwebp-encode.a',
176                 ],
177               'include_dirs': [
178                 'external/webp/include',
179               ],
180               },
181             }, { # skia_android_framework == 0
182               'direct_dependent_settings': {
183                 'defines': [
184                   'ENABLE_WEBP',
185                 ],
186                 },
187                 'link_settings': {
188                   'libraries': [
189                     '-lwebp',
190                   ],
191                 },
192               },
193             ],
194           ],
195         }
196       ],
197     }],
198   ],
199 }