{
'defines': [
'SK_BUILD_FOR_WIN32',
+ 'SK_NO_FLATE', # Too much of a pain to set up zlib on our bots.
'_CRT_SECURE_NO_WARNINGS',
'GR_GL_FUNCTION_TYPE=__stdcall',
],
# libpng in third_party/externals/libpng.
'skia_libpng_static%': '0',
- # skia_zlib_static - on OS variants that normally would link zlib with
- # '-lz' or libz.dylib and include the headers from '<zlib.h>',
- # don't do that; instead compile and staticlly link the version of
- # zlib in third_party/externals/zlib.
- 'skia_zlib_static%': '0',
-
# skia_no_fontconfig - On POSIX systems that would normally use the
# SkFontHost_fontconfig interface; use the SkFontHost_linux
# version instead.
'skia_freetype_static%': '<(skia_freetype_static)',
'skia_giflib_static%': '<(skia_giflib_static)',
'skia_libpng_static%': '<(skia_libpng_static)',
- 'skia_zlib_static%': '<(skia_zlib_static)',
'skia_no_fontconfig%': '<(skia_no_fontconfig)',
'skia_sanitizer%': '<(skia_sanitizer)',
'skia_scalar%': '<(skia_scalar)',
# found in the LICENSE file.
{
- 'variables': {
- 'skia_warnings_as_errors': 0,
- },
- 'targets': [
- {
- 'target_name': 'zlib',
+ 'targets': [{
+ 'target_name': 'zlib',
+ 'type': 'none',
+ 'link_settings': { 'libraries': [ '-lz' ] },
+ 'direct_dependent_settings': {
'conditions': [
- [ 'skia_zlib_static',
- {
- 'type': 'static_library',
- 'include_dirs': [
- '../third_party/externals/zlib',
- ],
- 'direct_dependent_settings': {
- 'defines': [
- 'SK_ZLIB_INCLUDE="zlib.h"',
- ],
- 'include_dirs': [
- '../third_party/externals/zlib',
- ],
- },
- 'sources': [
- '../third_party/externals/zlib/src/adler32.c',
- '../third_party/externals/zlib/src/compress.c',
- '../third_party/externals/zlib/src/crc32.c',
- '../third_party/externals/zlib/src/deflate.c',
- '../third_party/externals/zlib/src/gzclose.c',
- '../third_party/externals/zlib/src/gzlib.c',
- '../third_party/externals/zlib/src/gzread.c',
- '../third_party/externals/zlib/src/gzwrite.c',
- '../third_party/externals/zlib/src/infback.c',
- '../third_party/externals/zlib/src/inffast.c',
- '../third_party/externals/zlib/src/inflate.c',
- '../third_party/externals/zlib/src/inftrees.c',
- '../third_party/externals/zlib/src/trees.c',
- '../third_party/externals/zlib/src/uncompr.c',
- '../third_party/externals/zlib/src/zutil.c',
- ],
- }, { # not skia_zlib_static
- 'type': 'none',
- 'direct_dependent_settings': {
- 'conditions': [
- [ 'skia_android_framework', {
- 'include_dirs': [
- 'external/zlib',
- ],
- }, {
- 'defines': [
- 'SK_SYSTEM_ZLIB=1',
- ],
- }]
- ],
- 'link_settings': {
- 'conditions': [
- [ 'skia_os == "mac" or skia_os == "ios"', {
- 'libraries': [
- '$(SDKROOT)/usr/lib/libz.dylib',
- ]
- }, { # skia_os != "mac" and skia_os != "ios"
- 'libraries': [
- '-lz',
- ]
- }],
- ],
- }
- },
- }
- ]
- ]
- }
- ]
+ [ 'skia_android_framework', { 'include_dirs': [ 'external/zlib' ] }]
+ ],
+ },
+ }],
}
*/
//#define SK_DEFAULT_IMAGE_CACHE_LIMIT (1024 * 1024)
-/* If zlib is available and you want to support the flate compression
- algorithm (used in PDF generation), define SK_ZLIB_INCLUDE to be the
- include path. Alternatively, define SK_SYSTEM_ZLIB to use the system zlib
- library specified as "#include <zlib.h>".
+/* If zlib is not available or you don't want to support flate compression
+ in PDF generation, define SK_NO_FLATE.
*/
-//#define SK_ZLIB_INCLUDE <zlib.h>
-//#define SK_SYSTEM_ZLIB
+//#define SK_NO_FLATE
/* Define this to allow PDF scalars above 32k. The PDF/A spec doesn't allow
them, but modern PDF interpreters should handle them just fine.
# endif
#endif
-#if defined(SK_ZLIB_INCLUDE) && defined(SK_SYSTEM_ZLIB)
-# error "cannot define both SK_ZLIB_INCLUDE and SK_SYSTEM_ZLIB"
-#elif defined(SK_ZLIB_INCLUDE) || defined(SK_SYSTEM_ZLIB)
-# define SK_HAS_ZLIB
-#endif
-
///////////////////////////////////////////////////////////////////////////////
#ifndef SkNEW
#include "SkFlate.h"
#include "SkStream.h"
-#ifndef SK_HAS_ZLIB
+#ifdef SK_NO_FLATE
bool SkFlate::HaveFlate() { return false; }
bool SkFlate::Deflate(SkStream*, SkWStream*) { return false; }
bool SkFlate::Deflate(const void*, size_t, SkWStream*) { return false; }
namespace {
-#ifdef SK_SYSTEM_ZLIB
-#include <zlib.h>
-#else
-#include SK_ZLIB_INCLUDE
-#endif
+#include "zlib.h"
// static
const size_t kBufferSize = 1024;
}
DEF_TEST(Flate, reporter) {
-#ifdef SK_HAS_ZLIB
+#ifndef SK_NO_FLATE
REPORTER_ASSERT(reporter, SkFlate::HaveFlate());
#endif
if (SkFlate::HaveFlate()) {