blob: 64ad971798b538e83c4b37be2fa1e660de90697b [file] [log] [blame]
commit-bot@chromium.orga936e372013-03-14 14:42:18 +00001# 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': {
mtklein170e00d2014-06-30 12:33:11 -07007 'skia_warnings_as_errors': 0,
scroggo@google.comd4adfa32014-02-05 16:35:12 +00008 'conditions':[
9 ['skia_android_framework == 1', {
10 'use_system_libwebp': 1,
11 }, {
12 'use_system_libwebp%': 0,
13 }],
14 ],
commit-bot@chromium.orga936e372013-03-14 14:42:18 +000015 },
16 'conditions': [
17 ['use_system_libwebp==0', {
18 'targets': [
19 {
20 'target_name': 'libwebp_dec',
21 'type': 'static_library',
22 'include_dirs': [
23 '../third_party/externals/libwebp',
24 ],
25 'sources': [
djsollen@google.com42416ee2013-06-10 15:19:33 +000026 '../third_party/externals/libwebp/src/dec/alpha.c',
27 '../third_party/externals/libwebp/src/dec/buffer.c',
28 '../third_party/externals/libwebp/src/dec/frame.c',
29 '../third_party/externals/libwebp/src/dec/idec.c',
30 '../third_party/externals/libwebp/src/dec/io.c',
31 '../third_party/externals/libwebp/src/dec/layer.c',
32 '../third_party/externals/libwebp/src/dec/quant.c',
33 '../third_party/externals/libwebp/src/dec/tree.c',
34 '../third_party/externals/libwebp/src/dec/vp8.c',
35 '../third_party/externals/libwebp/src/dec/vp8l.c',
36 '../third_party/externals/libwebp/src/dec/webp.c',
37 ],
commit-bot@chromium.org4324c3b2014-02-21 20:11:42 +000038 'cflags': [ '-w' ],
djsollen@google.com42416ee2013-06-10 15:19:33 +000039 },
40 {
41 'target_name': 'libwebp_demux',
42 'type': 'static_library',
43 'include_dirs': [
44 '../third_party/externals/libwebp',
45 ],
46 'sources': [
47 '../third_party/externals/libwebp/src/demux/demux.c',
commit-bot@chromium.orga936e372013-03-14 14:42:18 +000048 ],
commit-bot@chromium.org4324c3b2014-02-21 20:11:42 +000049 'cflags': [ '-w' ],
commit-bot@chromium.orga936e372013-03-14 14:42:18 +000050 },
51 {
52 'target_name': 'libwebp_dsp',
53 'type': 'static_library',
54 'include_dirs': [
55 '../third_party/externals/libwebp',
56 ],
57 'sources': [
djsollen@google.com42416ee2013-06-10 15:19:33 +000058 '../third_party/externals/libwebp/src/dsp/cpu.c',
59 '../third_party/externals/libwebp/src/dsp/dec.c',
60 '../third_party/externals/libwebp/src/dsp/dec_sse2.c',
61 '../third_party/externals/libwebp/src/dsp/enc.c',
62 '../third_party/externals/libwebp/src/dsp/enc_sse2.c',
63 '../third_party/externals/libwebp/src/dsp/lossless.c',
64 '../third_party/externals/libwebp/src/dsp/upsampling.c',
65 '../third_party/externals/libwebp/src/dsp/upsampling_sse2.c',
66 '../third_party/externals/libwebp/src/dsp/yuv.c',
commit-bot@chromium.orga936e372013-03-14 14:42:18 +000067 ],
commit-bot@chromium.org4324c3b2014-02-21 20:11:42 +000068 'cflags': [ '-w' ],
commit-bot@chromium.orga936e372013-03-14 14:42:18 +000069 'conditions': [
70 ['skia_os == "android"', {
71 'dependencies' : [
72 'android_deps.gyp:cpu_features',
73 ],
74 }],
75 ],
76 },
77 {
78 'target_name': 'libwebp_dsp_neon',
79 'conditions': [
djsollen@google.comf7542ba2013-07-31 12:57:27 +000080 ['arm_version >= 7', {
commit-bot@chromium.orga936e372013-03-14 14:42:18 +000081 'type': 'static_library',
82 'include_dirs': [
83 '../third_party/externals/libwebp',
84 ],
85 'sources': [
djsollen@google.com42416ee2013-06-10 15:19:33 +000086 '../third_party/externals/libwebp/src/dsp/dec_neon.c',
djsollen@google.com110aff22013-06-10 16:50:18 +000087 '../third_party/externals/libwebp/src/dsp/enc_neon.c',
88 '../third_party/externals/libwebp/src/dsp/upsampling_neon.c',
commit-bot@chromium.orga936e372013-03-14 14:42:18 +000089 ],
90 # behavior similar dsp_neon.c.neon in an Android.mk
skia.committer@gmail.comc49cabf2013-03-15 07:05:19 +000091 'cflags!': [
commit-bot@chromium.orga936e372013-03-14 14:42:18 +000092 '-mfpu=vfpv3-d16',
commit-bot@chromium.orga936e372013-03-14 14:42:18 +000093 ],
commit-bot@chromium.org4324c3b2014-02-21 20:11:42 +000094 'cflags': [ '-mfpu=neon', '-w' ],
djsollen@google.comf7542ba2013-07-31 12:57:27 +000095 },{ # !(arm_version >= 7)
commit-bot@chromium.orga936e372013-03-14 14:42:18 +000096 'type': 'none',
97 }],
98 ],
99 },
100 {
101 'target_name': 'libwebp_enc',
102 'type': 'static_library',
103 'include_dirs': [
104 '../third_party/externals/libwebp',
105 ],
106 'sources': [
djsollen@google.com42416ee2013-06-10 15:19:33 +0000107 '../third_party/externals/libwebp/src/enc/alpha.c',
108 '../third_party/externals/libwebp/src/enc/analysis.c',
109 '../third_party/externals/libwebp/src/enc/backward_references.c',
110 '../third_party/externals/libwebp/src/enc/config.c',
111 '../third_party/externals/libwebp/src/enc/cost.c',
112 '../third_party/externals/libwebp/src/enc/filter.c',
113 '../third_party/externals/libwebp/src/enc/frame.c',
114 '../third_party/externals/libwebp/src/enc/histogram.c',
115 '../third_party/externals/libwebp/src/enc/iterator.c',
116 '../third_party/externals/libwebp/src/enc/layer.c',
117 '../third_party/externals/libwebp/src/enc/picture.c',
118 '../third_party/externals/libwebp/src/enc/quant.c',
119 '../third_party/externals/libwebp/src/enc/syntax.c',
120 '../third_party/externals/libwebp/src/enc/token.c',
121 '../third_party/externals/libwebp/src/enc/tree.c',
122 '../third_party/externals/libwebp/src/enc/vp8l.c',
123 '../third_party/externals/libwebp/src/enc/webpenc.c',
commit-bot@chromium.orga936e372013-03-14 14:42:18 +0000124 ],
commit-bot@chromium.orgea7e69a2013-10-28 22:05:12 +0000125 'cflags': [ '-w' ],
commit-bot@chromium.orga936e372013-03-14 14:42:18 +0000126 },
127 {
128 'target_name': 'libwebp_utils',
129 'type': 'static_library',
130 'include_dirs': [
131 '../third_party/externals/libwebp',
132 ],
133 'sources': [
djsollen@google.com42416ee2013-06-10 15:19:33 +0000134 '../third_party/externals/libwebp/src/utils/bit_reader.c',
135 '../third_party/externals/libwebp/src/utils/bit_writer.c',
136 '../third_party/externals/libwebp/src/utils/color_cache.c',
137 '../third_party/externals/libwebp/src/utils/filters.c',
138 '../third_party/externals/libwebp/src/utils/huffman.c',
139 '../third_party/externals/libwebp/src/utils/huffman_encode.c',
140 '../third_party/externals/libwebp/src/utils/quant_levels.c',
141 '../third_party/externals/libwebp/src/utils/quant_levels_dec.c',
142 '../third_party/externals/libwebp/src/utils/rescaler.c',
143 '../third_party/externals/libwebp/src/utils/thread.c',
144 '../third_party/externals/libwebp/src/utils/utils.c',
commit-bot@chromium.orga936e372013-03-14 14:42:18 +0000145 ],
commit-bot@chromium.org4324c3b2014-02-21 20:11:42 +0000146 'cflags': [ '-w' ],
commit-bot@chromium.orga936e372013-03-14 14:42:18 +0000147 },
148 {
149 'target_name': 'libwebp',
150 'type': 'none',
151 'dependencies' : [
152 'libwebp_dec',
djsollen@google.com42416ee2013-06-10 15:19:33 +0000153 'libwebp_demux',
commit-bot@chromium.orga936e372013-03-14 14:42:18 +0000154 'libwebp_dsp',
155 'libwebp_dsp_neon',
156 'libwebp_enc',
157 'libwebp_utils',
158 ],
159 'direct_dependent_settings': {
160 'include_dirs': [
djsollen@google.com42416ee2013-06-10 15:19:33 +0000161 '../third_party/externals/libwebp/src',
commit-bot@chromium.orga936e372013-03-14 14:42:18 +0000162 ],
mtklein170e00d2014-06-30 12:33:11 -0700163 'cflags': [
164 '-Wno-unused-function', # In C++11 mode, we get this warning when including decode.h.
165 ]
commit-bot@chromium.orga936e372013-03-14 14:42:18 +0000166 },
167 'conditions': [
168 ['OS!="win"', {'product_name': 'webp'}],
169 ],
170 },
171 ],
172 }, {
scroggo@google.comd4adfa32014-02-05 16:35:12 +0000173 # use_system_libwep == 1
commit-bot@chromium.orga936e372013-03-14 14:42:18 +0000174 'targets': [
175 {
176 'target_name': 'libwebp',
177 'type': 'none',
scroggo@google.comd4adfa32014-02-05 16:35:12 +0000178 'conditions': [
179 [ 'skia_android_framework', {
180 'direct_dependent_settings': {
181 'libraries': [
182 'libwebp-decode.a',
183 'libwebp-encode.a',
184 ],
185 'include_dirs': [
186 'external/webp/include',
187 ],
188 },
189 }, { # skia_android_framework == 0
190 'direct_dependent_settings': {
191 'defines': [
192 'ENABLE_WEBP',
193 ],
194 },
195 'link_settings': {
196 'libraries': [
197 '-lwebp',
198 ],
199 },
200 },
commit-bot@chromium.orga936e372013-03-14 14:42:18 +0000201 ],
scroggo@google.comd4adfa32014-02-05 16:35:12 +0000202 ],
commit-bot@chromium.orga936e372013-03-14 14:42:18 +0000203 }
204 ],
205 }],
206 ],
207}