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") {
11 use_dsp_neon = (cpu_arch == "arm64" ||
12 (cpu_arch == "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 = [
40 deps += [ ":libwebp_dsp_neon"]
44 source_set("libwebp_demux") {
48 all_dependent_configs = [
51 configs -= [ "//build/config/compiler:chromium_code" ]
52 configs += [ "//build/config/compiler:no_chromium_code" ]
56 source_set("libwebp_dsp") {
58 "dsp/alpha_processing.c",
59 "dsp/alpha_processing_sse2.c",
62 "dsp/dec_clip_tables.c",
70 "dsp/lossless_mips32.c",
71 "dsp/lossless_sse2.c",
73 "dsp/upsampling_sse2.c",
78 configs -= [ "//build/config/compiler:chromium_code" ]
79 configs += [ "//build/config/compiler:no_chromium_code" ]
81 all_dependent_configs = [
86 deps += [ "//third_party/android_tools:cpu_features" ]
90 # ['order_profiling != 0', {
91 # 'target_conditions' : [
92 # ['_toolset=="target"', {
93 # 'cflags!': [ '-finstrument-functions' ],
102 source_set("libwebp_dsp_neon") {
106 "dsp/lossless_neon.c",
107 "dsp/upsampling_neon.c",
110 include_dirs = [ "." ]
112 if (cpu_arch == "arm") {
113 # behavior similar to *.c.neon in an Android.mk
114 configs -= [ "//build/config/compiler:compiler_arm_fpu" ]
115 cflags = [ "-mfpu=neon" ]
116 } else if (cpu_arch == "arm64") {
117 # avoid an ICE with gcc-4.9: b/15574841
118 cflags = [ "-frename-registers" ]
122 # ['order_profiling != 0', {
123 # 'target_conditions' : [
124 # ['_toolset=="target"', {
125 # 'cflags!': [ '-finstrument-functions' ],
135 source_set("libwebp_enc") {
139 "enc/backward_references.c",
148 "enc/picture_psnr.c",
149 "enc/picture_rescale.c",
150 "enc/picture_tools.c",
158 configs -= [ "//build/config/compiler:chromium_code" ]
159 configs += [ "//build/config/compiler:no_chromium_code" ]
161 all_dependent_configs = [
166 source_set("libwebp_utils") {
168 "utils/bit_reader.c",
169 "utils/bit_writer.c",
170 "utils/color_cache.c",
173 "utils/huffman_encode.c",
174 "utils/quant_levels.c",
175 "utils/quant_levels_dec.c",
181 configs -= [ "//build/config/compiler:chromium_code" ]
182 configs += [ "//build/config/compiler:no_chromium_code" ]
184 all_dependent_configs = [
201 deps += [ ":libwebp_dsp_neon" ]