OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import("//build/config/arm.gni") | 5 import("//build/config/arm.gni") |
6 import("//build/config/sanitizers/sanitizers.gni") | 6 import("//build/config/sanitizers/sanitizers.gni") |
7 | 7 |
8 config("libwebp_config") { | 8 config("libwebp_config") { |
9 include_dirs = [ "." ] | 9 include_dirs = [ "." ] |
10 } | 10 } |
11 | 11 |
12 set_opt_level = | 12 set_opt_level = |
13 !is_debug && is_posix && (current_cpu == "arm" || current_cpu == "arm64") | 13 !is_debug && is_posix && (current_cpu == "arm" || current_cpu == "arm64") |
14 | 14 |
15 use_dsp_neon = | 15 use_dsp_neon = |
16 current_cpu == "arm64" || (current_cpu == "arm" && arm_version >= 7 && | 16 current_cpu == "arm64" || (current_cpu == "arm" && arm_version >= 7 && |
17 (arm_use_neon || arm_optionally_use_neon)) | 17 (arm_use_neon || arm_optionally_use_neon)) |
18 | 18 |
19 source_set("libwebp_dec") { | 19 static_library("libwebp_dec") { |
20 sources = [ | 20 sources = [ |
21 "dec/alpha.c", | 21 "dec/alpha.c", |
22 "dec/buffer.c", | 22 "dec/buffer.c", |
23 "dec/frame.c", | 23 "dec/frame.c", |
24 "dec/idec.c", | 24 "dec/idec.c", |
25 "dec/io.c", | 25 "dec/io.c", |
26 "dec/quant.c", | 26 "dec/quant.c", |
27 "dec/tree.c", | 27 "dec/tree.c", |
28 "dec/vp8.c", | 28 "dec/vp8.c", |
29 "dec/vp8l.c", | 29 "dec/vp8l.c", |
(...skipping 10 matching lines...) Expand all Loading... |
40 deps = [ | 40 deps = [ |
41 ":libwebp_dsp", | 41 ":libwebp_dsp", |
42 ":libwebp_utils", | 42 ":libwebp_utils", |
43 ] | 43 ] |
44 all_dependent_configs = [ ":libwebp_config" ] | 44 all_dependent_configs = [ ":libwebp_config" ] |
45 if (use_dsp_neon) { | 45 if (use_dsp_neon) { |
46 deps += [ ":libwebp_dsp_neon" ] | 46 deps += [ ":libwebp_dsp_neon" ] |
47 } | 47 } |
48 } | 48 } |
49 | 49 |
50 source_set("libwebp_demux") { | 50 static_library("libwebp_demux") { |
51 sources = [ | 51 sources = [ |
52 "demux/demux.c", | 52 "demux/demux.c", |
53 ] | 53 ] |
54 all_dependent_configs = [ ":libwebp_config" ] | 54 all_dependent_configs = [ ":libwebp_config" ] |
55 configs -= [ "//build/config/compiler:chromium_code" ] | 55 configs -= [ "//build/config/compiler:chromium_code" ] |
56 configs += [ "//build/config/compiler:no_chromium_code" ] | 56 configs += [ "//build/config/compiler:no_chromium_code" ] |
57 deps = [ | 57 deps = [ |
58 ":libwebp_utils", | 58 ":libwebp_utils", |
59 ] | 59 ] |
60 } | 60 } |
61 | 61 |
62 source_set("libwebp_dsp") { | 62 static_library("libwebp_dsp") { |
63 sources = [ | 63 sources = [ |
64 "dsp/alpha_processing.c", | 64 "dsp/alpha_processing.c", |
65 "dsp/alpha_processing_mips_dsp_r2.c", | 65 "dsp/alpha_processing_mips_dsp_r2.c", |
66 "dsp/argb.c", | 66 "dsp/argb.c", |
67 "dsp/argb_mips_dsp_r2.c", | 67 "dsp/argb_mips_dsp_r2.c", |
68 "dsp/cost.c", | 68 "dsp/cost.c", |
69 "dsp/cost_mips32.c", | 69 "dsp/cost_mips32.c", |
70 "dsp/cost_mips_dsp_r2.c", | 70 "dsp/cost_mips_dsp_r2.c", |
71 "dsp/cpu.c", | 71 "dsp/cpu.c", |
72 "dsp/dec.c", | 72 "dsp/dec.c", |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 configs += [ "//build/config/android:no_cygprofile_instrumentation" ] | 113 configs += [ "//build/config/android:no_cygprofile_instrumentation" ] |
114 } | 114 } |
115 if (current_cpu == "x86" || current_cpu == "x64") { | 115 if (current_cpu == "x86" || current_cpu == "x64") { |
116 defines = [ | 116 defines = [ |
117 "WEBP_HAVE_SSE2", | 117 "WEBP_HAVE_SSE2", |
118 "WEBP_HAVE_SSE41", | 118 "WEBP_HAVE_SSE41", |
119 ] | 119 ] |
120 } | 120 } |
121 } | 121 } |
122 | 122 |
123 source_set("libwebp_dsp_sse41") { | 123 static_library("libwebp_dsp_sse41") { |
124 sources = [ | 124 sources = [ |
125 "dsp/alpha_processing_sse41.c", | 125 "dsp/alpha_processing_sse41.c", |
126 "dsp/dec_sse41.c", | 126 "dsp/dec_sse41.c", |
127 "dsp/enc_sse41.c", | 127 "dsp/enc_sse41.c", |
128 "dsp/lossless_enc_sse41.c", | 128 "dsp/lossless_enc_sse41.c", |
129 ] | 129 ] |
130 configs -= [ "//build/config/compiler:chromium_code" ] | 130 configs -= [ "//build/config/compiler:chromium_code" ] |
131 configs += [ "//build/config/compiler:no_chromium_code" ] | 131 configs += [ "//build/config/compiler:no_chromium_code" ] |
132 if (set_opt_level) { | 132 if (set_opt_level) { |
133 configs -= [ "//build/config/compiler:default_optimization" ] | 133 configs -= [ "//build/config/compiler:default_optimization" ] |
134 configs += [ "//build/config/compiler:optimize_max" ] | 134 configs += [ "//build/config/compiler:optimize_max" ] |
135 } | 135 } |
136 | 136 |
137 all_dependent_configs = [ ":libwebp_config" ] | 137 all_dependent_configs = [ ":libwebp_config" ] |
138 if (!is_msan) { | 138 if (!is_msan) { |
139 if ((current_cpu == "x86" || current_cpu == "x64") && | 139 if ((current_cpu == "x86" || current_cpu == "x64") && |
140 (!is_win || is_clang)) { | 140 (!is_win || is_clang)) { |
141 cflags = [ "-msse4.1" ] | 141 cflags = [ "-msse4.1" ] |
142 } | 142 } |
143 } | 143 } |
144 } | 144 } |
145 | 145 |
146 source_set("libwebp_dsp_sse2") { | 146 static_library("libwebp_dsp_sse2") { |
147 sources = [ | 147 sources = [ |
148 "dsp/alpha_processing_sse2.c", | 148 "dsp/alpha_processing_sse2.c", |
149 "dsp/argb_sse2.c", | 149 "dsp/argb_sse2.c", |
150 "dsp/cost_sse2.c", | 150 "dsp/cost_sse2.c", |
151 "dsp/dec_sse2.c", | 151 "dsp/dec_sse2.c", |
152 "dsp/enc_sse2.c", | 152 "dsp/enc_sse2.c", |
153 "dsp/filters_sse2.c", | 153 "dsp/filters_sse2.c", |
154 "dsp/lossless_enc_sse2.c", | 154 "dsp/lossless_enc_sse2.c", |
155 "dsp/lossless_sse2.c", | 155 "dsp/lossless_sse2.c", |
156 "dsp/rescaler_sse2.c", | 156 "dsp/rescaler_sse2.c", |
(...skipping 10 matching lines...) Expand all Loading... |
167 all_dependent_configs = [ ":libwebp_config" ] | 167 all_dependent_configs = [ ":libwebp_config" ] |
168 if (!is_msan) { | 168 if (!is_msan) { |
169 if ((current_cpu == "x86" || current_cpu == "x64") && | 169 if ((current_cpu == "x86" || current_cpu == "x64") && |
170 (!is_win || is_clang)) { | 170 (!is_win || is_clang)) { |
171 cflags = [ "-msse2" ] | 171 cflags = [ "-msse2" ] |
172 } | 172 } |
173 } | 173 } |
174 } | 174 } |
175 | 175 |
176 if (use_dsp_neon) { | 176 if (use_dsp_neon) { |
177 source_set("libwebp_dsp_neon") { | 177 static_library("libwebp_dsp_neon") { |
178 sources = [ | 178 sources = [ |
179 "dsp/dec_neon.c", | 179 "dsp/dec_neon.c", |
180 "dsp/enc_neon.c", | 180 "dsp/enc_neon.c", |
181 "dsp/lossless_enc_neon.c", | 181 "dsp/lossless_enc_neon.c", |
182 "dsp/lossless_neon.c", | 182 "dsp/lossless_neon.c", |
183 "dsp/rescaler_neon.c", | 183 "dsp/rescaler_neon.c", |
184 "dsp/upsampling_neon.c", | 184 "dsp/upsampling_neon.c", |
185 ] | 185 ] |
186 | 186 |
187 include_dirs = [ "." ] | 187 include_dirs = [ "." ] |
(...skipping 12 matching lines...) Expand all Loading... |
200 cflags = [ "-frename-registers" ] | 200 cflags = [ "-frename-registers" ] |
201 } | 201 } |
202 | 202 |
203 if (is_android) { | 203 if (is_android) { |
204 configs -= [ "//build/config/android:default_cygprofile_instrumentation" ] | 204 configs -= [ "//build/config/android:default_cygprofile_instrumentation" ] |
205 configs += [ "//build/config/android:no_cygprofile_instrumentation" ] | 205 configs += [ "//build/config/android:no_cygprofile_instrumentation" ] |
206 } | 206 } |
207 } | 207 } |
208 } # use_dsp_neon | 208 } # use_dsp_neon |
209 | 209 |
210 source_set("libwebp_enc") { | 210 static_library("libwebp_enc") { |
211 sources = [ | 211 sources = [ |
212 "enc/alpha.c", | 212 "enc/alpha.c", |
213 "enc/analysis.c", | 213 "enc/analysis.c", |
214 "enc/backward_references.c", | 214 "enc/backward_references.c", |
215 "enc/config.c", | 215 "enc/config.c", |
216 "enc/cost.c", | 216 "enc/cost.c", |
217 "enc/delta_palettization.c", | 217 "enc/delta_palettization.c", |
218 "enc/filter.c", | 218 "enc/filter.c", |
219 "enc/frame.c", | 219 "enc/frame.c", |
220 "enc/histogram.c", | 220 "enc/histogram.c", |
(...skipping 25 matching lines...) Expand all Loading... |
246 ] | 246 ] |
247 } | 247 } |
248 | 248 |
249 config("libwebp_utils_warnings") { | 249 config("libwebp_utils_warnings") { |
250 if (is_clang) { | 250 if (is_clang) { |
251 # See https://code.google.com/p/webp/issues/detail?id=253. | 251 # See https://code.google.com/p/webp/issues/detail?id=253. |
252 cflags = [ "-Wno-incompatible-pointer-types" ] | 252 cflags = [ "-Wno-incompatible-pointer-types" ] |
253 } | 253 } |
254 } | 254 } |
255 | 255 |
256 source_set("libwebp_utils") { | 256 static_library("libwebp_utils") { |
257 sources = [ | 257 sources = [ |
258 "utils/bit_reader.c", | 258 "utils/bit_reader.c", |
259 "utils/bit_writer.c", | 259 "utils/bit_writer.c", |
260 "utils/color_cache.c", | 260 "utils/color_cache.c", |
261 "utils/filters.c", | 261 "utils/filters.c", |
262 "utils/huffman.c", | 262 "utils/huffman.c", |
263 "utils/huffman_encode.c", | 263 "utils/huffman_encode.c", |
264 "utils/quant_levels.c", | 264 "utils/quant_levels.c", |
265 "utils/quant_levels_dec.c", | 265 "utils/quant_levels_dec.c", |
266 "utils/random.c", | 266 "utils/random.c", |
(...skipping 19 matching lines...) Expand all Loading... |
286 ":libwebp_demux", | 286 ":libwebp_demux", |
287 ":libwebp_dsp", | 287 ":libwebp_dsp", |
288 ":libwebp_enc", | 288 ":libwebp_enc", |
289 ":libwebp_utils", | 289 ":libwebp_utils", |
290 ] | 290 ] |
291 public_configs = [ ":libwebp_config" ] | 291 public_configs = [ ":libwebp_config" ] |
292 if (use_dsp_neon) { | 292 if (use_dsp_neon) { |
293 deps += [ ":libwebp_dsp_neon" ] | 293 deps += [ ":libwebp_dsp_neon" ] |
294 } | 294 } |
295 } | 295 } |
OLD | NEW |