# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import("//build/config/arm.gni")
+
config("libwebp_config") {
include_dirs = [ "." ]
}
+use_dsp_neon = (cpu_arch == "arm64" ||
+ (cpu_arch == "arm" && arm_version >= 7 &&
+ (arm_use_neon || arm_optionally_use_neon)))
+
source_set("libwebp_dec") {
sources = [
"dec/alpha.c",
deps = [
":libwebp_dsp",
-# TODO(GYP):
-# ":libwebp_dsp_neon",
":libwebp_utils",
]
all_dependent_configs = [
":libwebp_config"
]
+ if (use_dsp_neon) {
+ deps += [ ":libwebp_dsp_neon"]
+ }
}
source_set("libwebp_demux") {
# ],
}
+if (use_dsp_neon) {
+
+source_set("libwebp_dsp_neon") {
+ sources = [
+ "dsp/dec_neon.c",
+ "dsp/enc_neon.c",
+ "dsp/lossless_neon.c",
+ "dsp/upsampling_neon.c",
+ ]
+
+ include_dirs = [ "." ]
+
+ if (cpu_arch == "arm") {
+ # behavior similar to *.c.neon in an Android.mk
+ configs -= [ "//build/config/compiler:compiler_arm_fpu" ]
+ cflags = [ "-mfpu=neon" ]
+ } else if (cpu_arch == "arm64") {
+ # avoid an ICE with gcc-4.9: b/15574841
+ cflags = [ "-frename-registers" ]
+ }
+
# TODO(GYP):
-# 'variables': {
-# 'neon_sources': [
-# "dsp/dec_neon.c",
-# "dsp/enc_neon.c",
-# "dsp/lossless_neon.c",
-# "dsp/upsampling_neon.c",
-# ]
-# },
-# {
-# 'target_name': 'libwebp_dsp_neon',
-# 'conditions': [
-# ['target_arch == "arm" and arm_version >= 7 and (arm_neon == 1 or arm_neon_optional == 1)', {
-# 'type': 'static_library',
-# 'include_dirs': ['.'],
-# 'sources': [
-# '<@(neon_sources)'
-# ],
-# # behavior similar to *.c.neon in an Android.mk
-# 'cflags!': [ '-mfpu=vfpv3-d16' ],
-# 'cflags': [ '-mfpu=neon' ],
-# },{
-# 'conditions': [
-# ['target_arch == "arm64"', {
-# 'type': 'static_library',
-# 'include_dirs': ['.'],
-# 'sources': [
-# '<@(neon_sources)'
-# ],
-# # avoid an ICE with gcc-4.9: b/15574841
-# 'cflags': [ '-frename-registers' ],
-# },{ # "target_arch != "arm|arm64" or arm_version < 7"
-# 'type': 'none',
-# }],
-# ],
-# }],
# ['order_profiling != 0', {
# 'target_conditions' : [
# ['_toolset=="target"', {
# }],
# ],
# }
+}
+
+} # use_dsp_neon
source_set("libwebp_enc") {
sources = [
":libwebp_dec",
":libwebp_demux",
":libwebp_dsp",
-# TODO(GYP):
-# ":libwebp_dsp_neon",
":libwebp_enc",
":libwebp_utils",
]
- direct_dependent_configs = [
+ public_configs = [
":libwebp_config"
]
+ if (use_dsp_neon) {
+ deps += [ ":libwebp_dsp_neon" ]
+ }
}