skia2/gyp/libwebp.gyp

204 lines
7.2 KiB
Plaintext
Raw Normal View History

# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'variables': {
'conditions':[
['skia_android_framework == 1', {
'use_system_libwebp': 1,
}, {
'use_system_libwebp%': 0,
}],
],
},
'conditions': [
['use_system_libwebp==0', {
'targets': [
{
'target_name': 'libwebp_dec',
'type': 'static_library',
'include_dirs': [
'../third_party/externals/libwebp',
],
'sources': [
'../third_party/externals/libwebp/src/dec/alpha.c',
'../third_party/externals/libwebp/src/dec/buffer.c',
'../third_party/externals/libwebp/src/dec/frame.c',
'../third_party/externals/libwebp/src/dec/idec.c',
'../third_party/externals/libwebp/src/dec/io.c',
'../third_party/externals/libwebp/src/dec/layer.c',
'../third_party/externals/libwebp/src/dec/quant.c',
'../third_party/externals/libwebp/src/dec/tree.c',
'../third_party/externals/libwebp/src/dec/vp8.c',
'../third_party/externals/libwebp/src/dec/vp8l.c',
'../third_party/externals/libwebp/src/dec/webp.c',
],
'cflags': [ '-w' ],
},
{
'target_name': 'libwebp_demux',
'type': 'static_library',
'include_dirs': [
'../third_party/externals/libwebp',
],
'sources': [
'../third_party/externals/libwebp/src/demux/demux.c',
],
'cflags': [ '-w' ],
},
{
'target_name': 'libwebp_dsp',
'type': 'static_library',
'include_dirs': [
'../third_party/externals/libwebp',
],
'sources': [
'../third_party/externals/libwebp/src/dsp/cpu.c',
'../third_party/externals/libwebp/src/dsp/dec.c',
'../third_party/externals/libwebp/src/dsp/dec_sse2.c',
'../third_party/externals/libwebp/src/dsp/enc.c',
'../third_party/externals/libwebp/src/dsp/enc_sse2.c',
'../third_party/externals/libwebp/src/dsp/lossless.c',
'../third_party/externals/libwebp/src/dsp/upsampling.c',
'../third_party/externals/libwebp/src/dsp/upsampling_sse2.c',
'../third_party/externals/libwebp/src/dsp/yuv.c',
],
'cflags': [ '-w' ],
'conditions': [
['skia_os == "android"', {
'dependencies' : [
'android_deps.gyp:cpu_features',
],
}],
],
},
{
'target_name': 'libwebp_dsp_neon',
'conditions': [
['arm_version >= 7', {
'type': 'static_library',
'include_dirs': [
'../third_party/externals/libwebp',
],
'sources': [
'../third_party/externals/libwebp/src/dsp/dec_neon.c',
'../third_party/externals/libwebp/src/dsp/enc_neon.c',
'../third_party/externals/libwebp/src/dsp/upsampling_neon.c',
],
# behavior similar dsp_neon.c.neon in an Android.mk
'cflags!': [
'-mfpu=vfpv3-d16',
],
'cflags': [ '-mfpu=neon', '-w' ],
},{ # !(arm_version >= 7)
'type': 'none',
}],
],
},
{
'target_name': 'libwebp_enc',
'type': 'static_library',
'include_dirs': [
'../third_party/externals/libwebp',
],
'sources': [
'../third_party/externals/libwebp/src/enc/alpha.c',
'../third_party/externals/libwebp/src/enc/analysis.c',
'../third_party/externals/libwebp/src/enc/backward_references.c',
'../third_party/externals/libwebp/src/enc/config.c',
'../third_party/externals/libwebp/src/enc/cost.c',
'../third_party/externals/libwebp/src/enc/filter.c',
'../third_party/externals/libwebp/src/enc/frame.c',
'../third_party/externals/libwebp/src/enc/histogram.c',
'../third_party/externals/libwebp/src/enc/iterator.c',
'../third_party/externals/libwebp/src/enc/layer.c',
'../third_party/externals/libwebp/src/enc/picture.c',
'../third_party/externals/libwebp/src/enc/quant.c',
'../third_party/externals/libwebp/src/enc/syntax.c',
'../third_party/externals/libwebp/src/enc/token.c',
'../third_party/externals/libwebp/src/enc/tree.c',
'../third_party/externals/libwebp/src/enc/vp8l.c',
'../third_party/externals/libwebp/src/enc/webpenc.c',
],
'cflags': [ '-w' ],
},
{
'target_name': 'libwebp_utils',
'type': 'static_library',
'include_dirs': [
'../third_party/externals/libwebp',
],
'sources': [
'../third_party/externals/libwebp/src/utils/bit_reader.c',
'../third_party/externals/libwebp/src/utils/bit_writer.c',
'../third_party/externals/libwebp/src/utils/color_cache.c',
'../third_party/externals/libwebp/src/utils/filters.c',
'../third_party/externals/libwebp/src/utils/huffman.c',
'../third_party/externals/libwebp/src/utils/huffman_encode.c',
'../third_party/externals/libwebp/src/utils/quant_levels.c',
'../third_party/externals/libwebp/src/utils/quant_levels_dec.c',
'../third_party/externals/libwebp/src/utils/rescaler.c',
'../third_party/externals/libwebp/src/utils/thread.c',
'../third_party/externals/libwebp/src/utils/utils.c',
],
'cflags': [ '-w' ],
},
{
'target_name': 'libwebp',
'type': 'none',
'dependencies' : [
'libwebp_dec',
'libwebp_demux',
'libwebp_dsp',
'libwebp_dsp_neon',
'libwebp_enc',
'libwebp_utils',
],
'direct_dependent_settings': {
'include_dirs': [
'../third_party/externals/libwebp/src',
],
},
'conditions': [
['OS!="win"', {'product_name': 'webp'}],
],
},
],
}, {
# use_system_libwep == 1
'targets': [
{
'target_name': 'libwebp',
'type': 'none',
'conditions': [
[ 'skia_android_framework', {
'direct_dependent_settings': {
'libraries': [
'libwebp-decode.a',
'libwebp-encode.a',
],
'include_dirs': [
'external/webp/include',
],
},
}, { # skia_android_framework == 0
'direct_dependent_settings': {
'defines': [
'ENABLE_WEBP',
],
},
'link_settings': {
'libraries': [
'-lwebp',
],
},
},
Gyp file changes for the android framework. Split off from https://codereview.chromium.org/140503007/. The eventual goal is to create our Android.mk from gyp. This patch adds an option for skia_android_framework with the right settings. The follow-up (https://codereview.chromium.org/140503007/) will use scripts to create the final makefile. gyp/android_deps.gyp: Use different dependencies for the framework than for building Skia normally. gyp/android_framework_lib.gyp: Like skia_lib, specifies the minimum needed for building Skia, in this case for the framework. gyp/common_conditions.gypi: Add settings specific to skia_android_framework. In some cases this means turning off flags and defines. gyp/common.gypi Turn off SK_DEBUG and SK_DEVELOPER when building for the framework. This allows the framework to create a single makefile which can be modified to add SK_DEBUG and SK_DEVELOPER as desired. gyp/common_variables.gypi: Add skia_android_framework. gyp/core.gyp: Don't depend on cpufeatures, and add the cutils library for skia_android_framework. gyp/freetype.gyp: skia_android_framework-specific options: Don't include freetype_static as a dependency. Include the proper folders. Include the android library. gyp/images.gyp: Don't export libjpeg as a dependency for targets that include images for the framework. Also reorder image decoders to match the Android order, leaving our most commonly used ones last (and therefore first in the chain for trying them). gyp/libwebp.gyp: Use the system webp when building for the Android framework. Specify the correct settings for the framework. gyp/opts.gyp: Specify a default set of files to compile when there are no possible optimizations. gyp/pdf.gyp: Add dependencies for Android framework. gyp/zlib.gyp: Include the zlib folder, and undefine SK_ZLIB_INCLUDE. BUG=skia:1975 R=djsollen@google.com Committed: https://code.google.com/p/skia/source/detail?r=13298 Review URL: https://codereview.chromium.org/153093003 git-svn-id: http://skia.googlecode.com/svn/trunk@13304 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-02-04 16:08:48 +00:00
],
],
}
],
}],
],
}