blob: 70fffdd925251c8c8fc7a2338c8c5e2898326850 [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',
mtklein449998d2014-12-15 12:23:00 -080031 '../third_party/externals/libwebp/src/dec/layer.c',
djsollen@google.com42416ee2013-06-10 15:19:33 +000032 '../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' ],
mtklein2bb034a2014-12-15 12:59:07 -080039 'xcode_settings': { 'WARNING_CFLAGS': [ '-w' ] },
djsollen@google.com42416ee2013-06-10 15:19:33 +000040 },
41 {
42 'target_name': 'libwebp_demux',
43 'type': 'static_library',
44 'include_dirs': [
45 '../third_party/externals/libwebp',
46 ],
47 'sources': [
48 '../third_party/externals/libwebp/src/demux/demux.c',
commit-bot@chromium.orga936e372013-03-14 14:42:18 +000049 ],
commit-bot@chromium.org4324c3b2014-02-21 20:11:42 +000050 'cflags': [ '-w' ],
mtklein2bb034a2014-12-15 12:59:07 -080051 'xcode_settings': { 'WARNING_CFLAGS': [ '-w' ] },
commit-bot@chromium.orga936e372013-03-14 14:42:18 +000052 },
53 {
54 'target_name': 'libwebp_dsp',
55 'type': 'static_library',
56 'include_dirs': [
57 '../third_party/externals/libwebp',
58 ],
59 'sources': [
djsollen@google.com42416ee2013-06-10 15:19:33 +000060 '../third_party/externals/libwebp/src/dsp/cpu.c',
61 '../third_party/externals/libwebp/src/dsp/dec.c',
62 '../third_party/externals/libwebp/src/dsp/dec_sse2.c',
63 '../third_party/externals/libwebp/src/dsp/enc.c',
64 '../third_party/externals/libwebp/src/dsp/enc_sse2.c',
65 '../third_party/externals/libwebp/src/dsp/lossless.c',
66 '../third_party/externals/libwebp/src/dsp/upsampling.c',
67 '../third_party/externals/libwebp/src/dsp/upsampling_sse2.c',
68 '../third_party/externals/libwebp/src/dsp/yuv.c',
commit-bot@chromium.orga936e372013-03-14 14:42:18 +000069 ],
commit-bot@chromium.org4324c3b2014-02-21 20:11:42 +000070 'cflags': [ '-w' ],
mtklein2bb034a2014-12-15 12:59:07 -080071 'xcode_settings': { 'WARNING_CFLAGS': [ '-w' ] },
commit-bot@chromium.orga936e372013-03-14 14:42:18 +000072 'conditions': [
73 ['skia_os == "android"', {
74 'dependencies' : [
75 'android_deps.gyp:cpu_features',
76 ],
77 }],
78 ],
79 },
80 {
81 'target_name': 'libwebp_dsp_neon',
82 'conditions': [
djsollen@google.comf7542ba2013-07-31 12:57:27 +000083 ['arm_version >= 7', {
commit-bot@chromium.orga936e372013-03-14 14:42:18 +000084 'type': 'static_library',
85 'include_dirs': [
86 '../third_party/externals/libwebp',
87 ],
88 'sources': [
djsollen@google.com42416ee2013-06-10 15:19:33 +000089 '../third_party/externals/libwebp/src/dsp/dec_neon.c',
djsollen@google.com110aff22013-06-10 16:50:18 +000090 '../third_party/externals/libwebp/src/dsp/enc_neon.c',
91 '../third_party/externals/libwebp/src/dsp/upsampling_neon.c',
commit-bot@chromium.orga936e372013-03-14 14:42:18 +000092 ],
93 # behavior similar dsp_neon.c.neon in an Android.mk
skia.committer@gmail.comc49cabf2013-03-15 07:05:19 +000094 'cflags!': [
commit-bot@chromium.orga936e372013-03-14 14:42:18 +000095 '-mfpu=vfpv3-d16',
commit-bot@chromium.orga936e372013-03-14 14:42:18 +000096 ],
commit-bot@chromium.org4324c3b2014-02-21 20:11:42 +000097 'cflags': [ '-mfpu=neon', '-w' ],
djsollen@google.comf7542ba2013-07-31 12:57:27 +000098 },{ # !(arm_version >= 7)
commit-bot@chromium.orga936e372013-03-14 14:42:18 +000099 'type': 'none',
100 }],
101 ],
102 },
103 {
104 'target_name': 'libwebp_enc',
105 'type': 'static_library',
106 'include_dirs': [
107 '../third_party/externals/libwebp',
108 ],
109 'sources': [
djsollen@google.com42416ee2013-06-10 15:19:33 +0000110 '../third_party/externals/libwebp/src/enc/alpha.c',
111 '../third_party/externals/libwebp/src/enc/analysis.c',
112 '../third_party/externals/libwebp/src/enc/backward_references.c',
113 '../third_party/externals/libwebp/src/enc/config.c',
114 '../third_party/externals/libwebp/src/enc/cost.c',
115 '../third_party/externals/libwebp/src/enc/filter.c',
116 '../third_party/externals/libwebp/src/enc/frame.c',
117 '../third_party/externals/libwebp/src/enc/histogram.c',
118 '../third_party/externals/libwebp/src/enc/iterator.c',
mtklein449998d2014-12-15 12:23:00 -0800119 '../third_party/externals/libwebp/src/enc/layer.c',
djsollen@google.com42416ee2013-06-10 15:19:33 +0000120 '../third_party/externals/libwebp/src/enc/picture.c',
121 '../third_party/externals/libwebp/src/enc/quant.c',
122 '../third_party/externals/libwebp/src/enc/syntax.c',
123 '../third_party/externals/libwebp/src/enc/token.c',
124 '../third_party/externals/libwebp/src/enc/tree.c',
125 '../third_party/externals/libwebp/src/enc/vp8l.c',
126 '../third_party/externals/libwebp/src/enc/webpenc.c',
commit-bot@chromium.orga936e372013-03-14 14:42:18 +0000127 ],
commit-bot@chromium.orgea7e69a2013-10-28 22:05:12 +0000128 'cflags': [ '-w' ],
mtklein2bb034a2014-12-15 12:59:07 -0800129 'xcode_settings': { 'WARNING_CFLAGS': [ '-w' ] },
commit-bot@chromium.orga936e372013-03-14 14:42:18 +0000130 },
131 {
132 'target_name': 'libwebp_utils',
133 'type': 'static_library',
134 'include_dirs': [
135 '../third_party/externals/libwebp',
136 ],
137 'sources': [
djsollen@google.com42416ee2013-06-10 15:19:33 +0000138 '../third_party/externals/libwebp/src/utils/bit_reader.c',
139 '../third_party/externals/libwebp/src/utils/bit_writer.c',
140 '../third_party/externals/libwebp/src/utils/color_cache.c',
141 '../third_party/externals/libwebp/src/utils/filters.c',
142 '../third_party/externals/libwebp/src/utils/huffman.c',
143 '../third_party/externals/libwebp/src/utils/huffman_encode.c',
144 '../third_party/externals/libwebp/src/utils/quant_levels.c',
145 '../third_party/externals/libwebp/src/utils/quant_levels_dec.c',
146 '../third_party/externals/libwebp/src/utils/rescaler.c',
147 '../third_party/externals/libwebp/src/utils/thread.c',
148 '../third_party/externals/libwebp/src/utils/utils.c',
commit-bot@chromium.orga936e372013-03-14 14:42:18 +0000149 ],
commit-bot@chromium.org4324c3b2014-02-21 20:11:42 +0000150 'cflags': [ '-w' ],
mtklein2bb034a2014-12-15 12:59:07 -0800151 'xcode_settings': { 'WARNING_CFLAGS': [ '-w' ] },
commit-bot@chromium.orga936e372013-03-14 14:42:18 +0000152 },
153 {
154 'target_name': 'libwebp',
155 'type': 'none',
156 'dependencies' : [
157 'libwebp_dec',
djsollen@google.com42416ee2013-06-10 15:19:33 +0000158 'libwebp_demux',
commit-bot@chromium.orga936e372013-03-14 14:42:18 +0000159 'libwebp_dsp',
160 'libwebp_dsp_neon',
161 'libwebp_enc',
162 'libwebp_utils',
163 ],
164 'direct_dependent_settings': {
165 'include_dirs': [
djsollen@google.com42416ee2013-06-10 15:19:33 +0000166 '../third_party/externals/libwebp/src',
commit-bot@chromium.orga936e372013-03-14 14:42:18 +0000167 ],
mtklein65fd5992015-02-03 13:24:36 -0800168 'cflags': [ '-w' ],
169 'xcode_settings': { 'WARNING_CFLAGS': [ '-w' ] },
commit-bot@chromium.orga936e372013-03-14 14:42:18 +0000170 },
171 'conditions': [
172 ['OS!="win"', {'product_name': 'webp'}],
173 ],
174 },
175 ],
176 }, {
scroggo@google.comd4adfa32014-02-05 16:35:12 +0000177 # use_system_libwep == 1
commit-bot@chromium.orga936e372013-03-14 14:42:18 +0000178 'targets': [
179 {
180 'target_name': 'libwebp',
181 'type': 'none',
scroggo@google.comd4adfa32014-02-05 16:35:12 +0000182 'conditions': [
183 [ 'skia_android_framework', {
184 'direct_dependent_settings': {
185 'libraries': [
186 'libwebp-decode.a',
187 'libwebp-encode.a',
188 ],
189 'include_dirs': [
190 'external/webp/include',
191 ],
192 },
193 }, { # skia_android_framework == 0
194 'direct_dependent_settings': {
195 'defines': [
196 'ENABLE_WEBP',
197 ],
198 },
199 'link_settings': {
200 'libraries': [
201 '-lwebp',
202 ],
203 },
204 },
commit-bot@chromium.orga936e372013-03-14 14:42:18 +0000205 ],
scroggo@google.comd4adfa32014-02-05 16:35:12 +0000206 ],
commit-bot@chromium.orga936e372013-03-14 14:42:18 +0000207 }
208 ],
209 }],
210 ],
211}