Include gif image decoding in images/ on linux.

Build SkImageDecoder_libgif in images project and link against
libgif on linux.

Ensure that the GIF decoder is used in skimage.

Requires a new dependency on libgif-dev when building on linux.

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

git-svn-id: http://skia.googlecode.com/svn/trunk@8627 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
scroggo@google.com 2013-04-11 18:32:01 +00:00
parent 83165a5f71
commit 9c5f969e70
2 changed files with 10 additions and 7 deletions

View File

@ -97,12 +97,7 @@
],
}],
[ 'skia_os in ["linux", "freebsd", "openbsd", "solaris", "nacl"]', {
'sources!': [
'../src/images/SkImageDecoder_libgif.cpp',
'../src/images/SkMovie_gif.cpp',
],
# libpng stuff:
# Any targets that depend on this target should link in libpng and
# 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': {
@ -110,11 +105,12 @@
'../src/images/SkImageDecoder_libpng.cpp',
],
'libraries': [
'-lgif',
'-lpng',
'-lz',
],
},
# end libpng stuff
# end libpng/libgif stuff
}],
[ 'skia_os == "android"', {
'include_dirs': [

View File

@ -159,8 +159,15 @@ int tool_main(int argc, char** argv) {
void forceLinking();
void forceLinking() {
// This function leaks, but that is okay because it is not intended
// to be called. It is only here so that the linker will include the
// decoders.
SkDEBUGCODE(SkImageDecoder *creator = ) CreateJPEGImageDecoder();
SkASSERT(creator);
#ifdef SK_BUILD_FOR_UNIX
SkDEBUGCODE(creator = ) CreateGIFImageDecoder();
SkASSERT(creator);
#endif
}
#if !defined SK_BUILD_FOR_IOS