Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(25)

Side by Side Diff: third_party/libwebp/BUILD.gn

Issue 1178013008: Use the upstream version of libwebp, v0.4.3. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fixes for SkWebpImageDecoder and SkWebpCodec. Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 # Copyright 2014 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 import("//build/config/arm.gni")
6
7 config("libwebp_config") {
8 include_dirs = [ "." ]
9 }
10
11 use_dsp_neon =
12 cpu_arch == "arm64" || (cpu_arch == "arm" && arm_version >= 7 &&
13 (arm_use_neon || arm_optionally_use_neon))
14
15 source_set("libwebp_dec") {
16 sources = [
17 "dec/alpha.c",
18 "dec/buffer.c",
19 "dec/frame.c",
20 "dec/idec.c",
21 "dec/io.c",
22 "dec/quant.c",
23 "dec/tree.c",
24 "dec/vp8.c",
25 "dec/vp8l.c",
26 "dec/webp.c",
27 ]
28
29 configs -= [ "//build/config/compiler:chromium_code" ]
30 configs += [ "//build/config/compiler:no_chromium_code" ]
31
32 deps = [
33 ":libwebp_dsp",
34 ":libwebp_utils",
35 ]
36 all_dependent_configs = [ ":libwebp_config" ]
37 if (use_dsp_neon) {
38 deps += [ ":libwebp_dsp_neon" ]
39 }
40 }
41
42 source_set("libwebp_demux") {
43 sources = [
44 "demux/demux.c",
45 ]
46 all_dependent_configs = [ ":libwebp_config" ]
47 configs -= [ "//build/config/compiler:chromium_code" ]
48 configs += [ "//build/config/compiler:no_chromium_code" ]
49 }
50
51 source_set("libwebp_dsp") {
52 sources = [
53 "dsp/alpha_processing.c",
54 "dsp/alpha_processing_sse2.c",
55 "dsp/cpu.c",
56 "dsp/dec.c",
57 "dsp/dec_clip_tables.c",
58 "dsp/dec_mips32.c",
59 "dsp/dec_sse2.c",
60 "dsp/enc.c",
61 "dsp/enc_avx2.c",
62 "dsp/enc_mips32.c",
63 "dsp/enc_sse2.c",
64 "dsp/lossless.c",
65 "dsp/lossless_mips32.c",
66 "dsp/lossless_sse2.c",
67 "dsp/upsampling.c",
68 "dsp/upsampling_sse2.c",
69 "dsp/yuv.c",
70 "dsp/yuv_mips32.c",
71 "dsp/yuv_sse2.c",
72 ]
73 configs -= [ "//build/config/compiler:chromium_code" ]
74 configs += [ "//build/config/compiler:no_chromium_code" ]
75
76 all_dependent_configs = [ ":libwebp_config" ]
77 deps = []
78 if (is_android) {
79 deps += [ "//third_party/android_tools:cpu_features" ]
80 }
81
82 # TODO(GYP):
83 # 'conditions': [
84 # ['order_profiling != 0', {
85 # 'target_conditions' : [
86 # ['_toolset=="target"', {
87 # 'cflags!': [ '-finstrument-functions' ],
88 # }],
89 # ],
90 # }],
91 # ],
92 }
93
94 if (use_dsp_neon) {
95 source_set("libwebp_dsp_neon") {
96 sources = [
97 "dsp/dec_neon.c",
98 "dsp/enc_neon.c",
99 "dsp/lossless_neon.c",
100 "dsp/upsampling_neon.c",
101 ]
102
103 include_dirs = [ "." ]
104
105 if (cpu_arch == "arm") {
106 # behavior similar to *.c.neon in an Android.mk
107 configs -= [ "//build/config/compiler:compiler_arm_fpu" ]
108 cflags = [ "-mfpu=neon" ]
109 } else if (cpu_arch == "arm64") {
110 # avoid an ICE with gcc-4.9: b/15574841
111 cflags = [ "-frename-registers" ]
112 }
113
114 # TODO(GYP):
115 # ['order_profiling != 0', {
116 # 'target_conditions' : [
117 # ['_toolset=="target"', {
118 # 'cflags!': [ '-finstrument-functions' ],
119 # }],
120 # ],
121 # }],
122 # ],
123 # }
124 }
125 } # use_dsp_neon
126
127 source_set("libwebp_enc") {
128 sources = [
129 "enc/alpha.c",
130 "enc/analysis.c",
131 "enc/backward_references.c",
132 "enc/config.c",
133 "enc/cost.c",
134 "enc/filter.c",
135 "enc/frame.c",
136 "enc/histogram.c",
137 "enc/iterator.c",
138 "enc/picture.c",
139 "enc/picture_csp.c",
140 "enc/picture_psnr.c",
141 "enc/picture_rescale.c",
142 "enc/picture_tools.c",
143 "enc/quant.c",
144 "enc/syntax.c",
145 "enc/token.c",
146 "enc/tree.c",
147 "enc/vp8l.c",
148 "enc/webpenc.c",
149 ]
150 configs -= [ "//build/config/compiler:chromium_code" ]
151 configs += [ "//build/config/compiler:no_chromium_code" ]
152
153 all_dependent_configs = [ ":libwebp_config" ]
154 }
155
156 source_set("libwebp_utils") {
157 sources = [
158 "utils/bit_reader.c",
159 "utils/bit_writer.c",
160 "utils/color_cache.c",
161 "utils/filters.c",
162 "utils/huffman.c",
163 "utils/huffman_encode.c",
164 "utils/quant_levels.c",
165 "utils/quant_levels_dec.c",
166 "utils/random.c",
167 "utils/rescaler.c",
168 "utils/thread.c",
169 "utils/utils.c",
170 ]
171 configs -= [ "//build/config/compiler:chromium_code" ]
172 configs += [ "//build/config/compiler:no_chromium_code" ]
173
174 all_dependent_configs = [ ":libwebp_config" ]
175 }
176
177 group("libwebp") {
178 deps = [
179 ":libwebp_dec",
180 ":libwebp_demux",
181 ":libwebp_dsp",
182 ":libwebp_enc",
183 ":libwebp_utils",
184 ]
185 public_configs = [ ":libwebp_config" ]
186 if (use_dsp_neon) {
187 deps += [ ":libwebp_dsp_neon" ]
188 }
189 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698