Skip to content

Commit

Permalink
GN rules for libwebp dsp neon stuff
Browse files Browse the repository at this point in the history
This stuff is needed to get blink linking in android.

R=brettw@chromium.org,fbarchard@chromium.org

Review URL: https://codereview.chromium.org/541953002

Cr-Commit-Position: refs/heads/master@{#293668}
  • Loading branch information
jamesr authored and Commit bot committed Sep 7, 2014
1 parent a008610 commit 4a8306f
Showing 1 changed file with 36 additions and 39 deletions.
75 changes: 36 additions & 39 deletions third_party/libwebp/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,16 @@
# 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",
Expand All @@ -25,13 +31,14 @@ source_set("libwebp_dec") {

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") {
Expand Down Expand Up @@ -89,42 +96,28 @@ source_set("libwebp_dsp") {
# ],
}

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"', {
Expand All @@ -134,6 +127,9 @@ source_set("libwebp_dsp") {
# }],
# ],
# }
}

} # use_dsp_neon

source_set("libwebp_enc") {
sources = [
Expand Down Expand Up @@ -194,12 +190,13 @@ group("libwebp") {
":libwebp_dec",
":libwebp_demux",
":libwebp_dsp",
# TODO(GYP):
# ":libwebp_dsp_neon",
":libwebp_enc",
":libwebp_utils",
]
direct_dependent_configs = [
":libwebp_config"
]
if (use_dsp_neon) {
deps += [ ":libwebp_dsp_neon" ]
}
}

0 comments on commit 4a8306f

Please sign in to comment.