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" ]
51 source_set("libwebp_dsp") {
53 "dsp/alpha_processing.c",
54 "dsp/alpha_processing_sse2.c",
57 "dsp/dec_clip_tables.c",
65 "dsp/lossless_mips32.c",
66 "dsp/lossless_sse2.c",
68 "dsp/upsampling_sse2.c",
73 configs -= [ "//build/config/compiler:chromium_code" ]
74 configs += [ "//build/config/compiler:no_chromium_code" ]
76 all_dependent_configs = [ ":libwebp_config" ]
79 deps += [ "//third_party/android_tools:cpu_features" ]
84 # ['order_profiling != 0', {
85 # 'target_conditions' : [
86 # ['_toolset=="target"', {
87 # 'cflags!': [ '-finstrument-functions' ],
95 source_set("libwebp_dsp_neon") {
99 "dsp/lossless_neon.c",
100 "dsp/upsampling_neon.c",
103 include_dirs = [ "." ]
105 if (current_cpu == "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 (current_cpu == "arm64") {
110 # avoid an ICE with gcc-4.9: b/15574841
111 cflags = [ "-frename-registers" ]
115 # ['order_profiling != 0', {
116 # 'target_conditions' : [
117 # ['_toolset=="target"', {
118 # 'cflags!': [ '-finstrument-functions' ],
127 source_set("libwebp_enc") {
131 "enc/backward_references.c",
140 "enc/picture_psnr.c",
141 "enc/picture_rescale.c",
142 "enc/picture_tools.c",
150 configs -= [ "//build/config/compiler:chromium_code" ]
151 configs += [ "//build/config/compiler:no_chromium_code" ]
153 all_dependent_configs = [ ":libwebp_config" ]
156 source_set("libwebp_utils") {
158 "utils/bit_reader.c",
159 "utils/bit_writer.c",
160 "utils/color_cache.c",
163 "utils/huffman_encode.c",
164 "utils/quant_levels.c",
165 "utils/quant_levels_dec.c",
171 configs -= [ "//build/config/compiler:chromium_code" ]
172 configs += [ "//build/config/compiler:no_chromium_code" ]
174 all_dependent_configs = [ ":libwebp_config" ]
185 public_configs = [ ":libwebp_config" ]
187 deps += [ ":libwebp_dsp_neon" ]