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.
5 import("//build/config/arm.gni")
7 config("libwebp_config") {
12 current_cpu == "arm64" || (current_cpu == "arm" && arm_version >= 7 &&
13 (arm_use_neon || arm_optionally_use_neon))
15 source_set("libwebp_dec") {
29 configs -= [ "//build/config/compiler:chromium_code" ]
30 configs += [ "//build/config/compiler:no_chromium_code" ]
36 all_dependent_configs = [ ":libwebp_config" ]
38 deps += [ ":libwebp_dsp_neon" ]
42 source_set("libwebp_demux") {
46 all_dependent_configs = [ ":libwebp_config" ]
47 configs -= [ "//build/config/compiler:chromium_code" ]
48 configs += [ "//build/config/compiler:no_chromium_code" ]
54 source_set("libwebp_dsp") {
56 "dsp/alpha_processing.c",
57 "dsp/alpha_processing_sse2.c",
60 "dsp/dec_clip_tables.c",
68 "dsp/lossless_mips32.c",
69 "dsp/lossless_sse2.c",
71 "dsp/upsampling_sse2.c",
76 configs -= [ "//build/config/compiler:chromium_code" ]
77 configs += [ "//build/config/compiler:no_chromium_code" ]
79 all_dependent_configs = [ ":libwebp_config" ]
84 deps += [ "//third_party/android_tools:cpu_features" ]
89 # ['order_profiling != 0', {
90 # 'target_conditions' : [
91 # ['_toolset=="target"', {
92 # 'cflags!': [ '-finstrument-functions' ],
100 source_set("libwebp_dsp_neon") {
104 "dsp/lossless_neon.c",
105 "dsp/upsampling_neon.c",
108 include_dirs = [ "." ]
110 if (current_cpu == "arm") {
111 # behavior similar to *.c.neon in an Android.mk
112 configs -= [ "//build/config/compiler:compiler_arm_fpu" ]
113 cflags = [ "-mfpu=neon" ]
114 } else if (current_cpu == "arm64") {
115 # avoid an ICE with gcc-4.9: b/15574841
116 cflags = [ "-frename-registers" ]
120 # ['order_profiling != 0', {
121 # 'target_conditions' : [
122 # ['_toolset=="target"', {
123 # 'cflags!': [ '-finstrument-functions' ],
132 source_set("libwebp_enc") {
136 "enc/backward_references.c",
145 "enc/picture_psnr.c",
146 "enc/picture_rescale.c",
147 "enc/picture_tools.c",
155 configs -= [ "//build/config/compiler:chromium_code" ]
156 configs += [ "//build/config/compiler:no_chromium_code" ]
158 all_dependent_configs = [ ":libwebp_config" ]
165 source_set("libwebp_utils") {
167 "utils/bit_reader.c",
168 "utils/bit_writer.c",
169 "utils/color_cache.c",
172 "utils/huffman_encode.c",
173 "utils/quant_levels.c",
174 "utils/quant_levels_dec.c",
180 configs -= [ "//build/config/compiler:chromium_code" ]
181 configs += [ "//build/config/compiler:no_chromium_code" ]
183 all_dependent_configs = [ ":libwebp_config" ]
185 config("libwebp_utils_warnings") {
187 # See https://code.google.com/p/webp/issues/detail?id=253.
188 cflags = [ "-Wno-incompatible-pointer-types" ]
191 public_configs = [ ":libwebp_utils_warnings" ]
202 public_configs = [ ":libwebp_config" ]
204 deps += [ ":libwebp_dsp_neon" ]