skia2/gyp/images.gyp
scroggo@google.com 1c9bd55ea3 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

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

git-svn-id: http://skia.googlecode.com/svn/trunk@13298 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-02-04 14:50:20 +00:00

194 lines
6.4 KiB
Python

# GYP file for images project.
{
'targets': [
{
'target_name': 'images',
'product_name': 'skia_images',
'type': 'static_library',
'standalone_static_library': 1,
'dependencies': [
'core.gyp:*',
'libjpeg.gyp:*',
'libwebp.gyp:libwebp',
'utils.gyp:utils',
],
'conditions': [
[ 'skia_android_framework == 0', {
'export_dependent_settings': [
'libjpeg.gyp:*',
],
}],
],
'include_dirs': [
'../include/images',
'../src/lazy',
# for access to SkErrorInternals.h
'../src/core/',
# for access to SkImagePriv.h
'../src/image/',
# So src/ports/SkImageDecoder_CG can access SkStreamHelpers.h
'../src/images/',
],
'sources': [
'../include/images/SkForceLinking.h',
'../include/images/SkImageRef.h',
'../include/images/SkImageRef_GlobalPool.h',
'../src/images/SkJpegUtility.h',
'../include/images/SkMovie.h',
'../include/images/SkPageFlipper.h',
'../src/images/bmpdecoderhelper.cpp',
'../src/images/bmpdecoderhelper.h',
'../src/images/SkDecodingImageGenerator.cpp',
'../src/images/SkDecodingImageGenerator.h',
'../src/images/SkForceLinking.cpp',
'../src/images/SkImageDecoder.cpp',
'../src/images/SkImageDecoder_FactoryDefault.cpp',
'../src/images/SkImageDecoder_FactoryRegistrar.cpp',
# If decoders are added/removed to/from (all/individual)
# platform(s), be sure to update SkForceLinking.cpp
# so the right decoders will be forced to link.
# IMPORTANT: The build order of the SkImageDecoder_*.cpp files
# defines the order image decoders are tested when decoding a
# stream. The last decoder is the first one tested, so the .cpp
# files should be in listed in order from the least likely to be
# used, to the most likely (jpeg and png should be the last two
# for instance.) As a result, they are deliberately not in
# alphabetical order.
'../src/images/SkImageDecoder_wbmp.cpp',
'../src/images/SkImageDecoder_libbmp.cpp',
'../src/images/SkImageDecoder_libgif.cpp',
'../src/images/SkImageDecoder_libico.cpp',
'../src/images/SkImageDecoder_libwebp.cpp',
'../src/images/SkImageDecoder_libjpeg.cpp',
'../src/images/SkImageDecoder_libpng.cpp',
'../src/images/SkImageEncoder.cpp',
'../src/images/SkImageEncoder_Factory.cpp',
'../src/images/SkImageEncoder_argb.cpp',
'../src/images/SkImageRef.cpp',
'../src/images/SkImageRefPool.cpp',
'../src/images/SkImageRefPool.h',
'../src/images/SkImageRef_ashmem.h',
'../src/images/SkImageRef_ashmem.cpp',
'../src/images/SkImageRef_GlobalPool.cpp',
'../src/images/SkImages.cpp',
'../src/images/SkJpegUtility.cpp',
'../src/images/SkMovie.cpp',
'../src/images/SkMovie_gif.cpp',
'../src/images/SkPageFlipper.cpp',
'../src/images/SkScaledBitmapSampler.cpp',
'../src/images/SkScaledBitmapSampler.h',
'../src/images/SkStreamHelpers.cpp',
'../src/images/SkStreamHelpers.h',
'../src/ports/SkImageDecoder_CG.cpp',
'../src/ports/SkImageDecoder_WIC.cpp',
],
'conditions': [
[ 'skia_os == "win"', {
'sources!': [
'../src/images/SkImageDecoder_FactoryDefault.cpp',
'../src/images/SkImageDecoder_libgif.cpp',
'../src/images/SkImageDecoder_libpng.cpp',
'../src/images/SkMovie_gif.cpp',
],
'link_settings': {
'libraries': [
'-lwindowscodecs.lib',
],
},
},{ #else if skia_os != win
'sources!': [
'../src/ports/SkImageDecoder_WIC.cpp',
],
}],
[ 'skia_os in ["mac", "ios"]', {
'sources!': [
'../src/images/SkImageDecoder_FactoryDefault.cpp',
'../src/images/SkImageDecoder_libpng.cpp',
'../src/images/SkImageDecoder_libgif.cpp',
'../src/images/SkMovie_gif.cpp',
],
},{ #else if skia_os != mac
'sources!': [
'../src/ports/SkImageDecoder_CG.cpp',
],
}],
[ 'skia_os in ["linux", "freebsd", "openbsd", "solaris"]', {
# Any targets that depend on this target should link in libpng, libgif, and
# our code that calls it.
# See http://code.google.com/p/gyp/wiki/InputFormatReference#Dependent_Settings
'link_settings': {
'libraries': [
'-lgif',
'-lpng',
'-lz',
],
},
# end libpng/libgif stuff
}],
# FIXME: NaCl should be just like linux, etc, above, but it currently is separated out
# to remove gif. Once gif is supported by naclports, this can be merged into the above
# condition.
[ 'skia_os == "nacl"', {
'sources!': [
'../src/images/SkImageDecoder_libgif.cpp',
'../src/images/SkMovie_gif.cpp',
],
'link_settings': {
'libraries': [
'-lpng',
'-lz',
],
},
}],
[ 'skia_os == "android"', {
'include_dirs': [
'../src/utils',
],
'dependencies': [
'android_deps.gyp:gif',
'android_deps.gyp:png',
],
'conditions': [
[ 'skia_android_framework == 0', {
'export_dependent_settings': [
'android_deps.gyp:png'
],
}],
],
},{ #else if skia_os != android
'sources!': [
'../src/images/SkImageRef_ashmem.h',
'../src/images/SkImageRef_ashmem.cpp',
],
}],
[ 'skia_os == "chromeos"', {
'dependencies': [
'chromeos_deps.gyp:gif',
],
'link_settings': {
'libraries': [
'-lpng',
],
},
}],
[ 'skia_os == "ios"', {
'include_dirs': [
'../include/utils/mac',
],
}],
],
'direct_dependent_settings': {
'include_dirs': [
'../include/images',
],
},
},
],
}