On windows, build zlib as a static library.

Partially in preparation for building libpng on Windows.

Also, this makes us consistent across platforms for PDF.

Uses the version of zlib checked into the Chromium tree.

Remove miniz, which is replaced by zlib.

Review URL: https://codereview.chromium.org/966963002
This commit is contained in:
scroggo 2015-03-02 06:24:15 -08:00 committed by Commit bot
parent db873d8677
commit 3da9181cd5
6 changed files with 90 additions and 4976 deletions

3
DEPS
View File

@ -16,7 +16,8 @@ deps = {
"third_party/externals/jsoncpp" : "https://chromium.googlesource.com/external/jsoncpp/jsoncpp.git@1afff032c83e26ddf7f2776e8b43de5ad666c1fa",
"third_party/externals/libjpeg" : "https://chromium.googlesource.com/chromium/deps/libjpeg_turbo.git@82ce8a6d4ebe12a177c0c3597192f2b4f09e81c3",
"third_party/externals/libwebp" : "https://chromium.googlesource.com/webm/libwebp.git@3fe91635df8734b23f3c1b9d1f0c4fa8cfaf4e39",
"third_party/externals/nanomsg": "https://skia.googlesource.com/third_party/nanomsg.git@0.4-beta",
"third_party/externals/nanomsg" : "https://skia.googlesource.com/third_party/nanomsg.git@0.4-beta",
"third_party/externals/zlib" : "https://chromium.googlesource.com/chromium/src/third_party/zlib@4ba7cdd0e7bf49d671645264f839838fc56e1492",
"platform_tools/android/third_party/externals/expat" : "https://android.googlesource.com/platform/external/expat.git@android-4.2.2_r1.2",
"platform_tools/android/third_party/externals/gif" : "https://android.googlesource.com/platform/external/giflib.git@android-4.2.2_r1.2",

View File

@ -4,13 +4,9 @@
{
'target_name': 'skflate',
'type': 'static_library',
'dependencies': [ 'skia_lib.gyp:skia_lib' ],
'conditions': [
[ 'skia_android_framework', {
'dependencies': [ 'zlib.gyp:zlib' ]
},{
'dependencies': [ 'zlib.gyp:miniz' ] # Our bots.
}],
'dependencies': [
'skia_lib.gyp:skia_lib',
'zlib.gyp:zlib',
],
'sources': [ '../src/core/SkFlate.cpp' ],
},

View File

@ -4,28 +4,92 @@
# found in the LICENSE file.
{
'targets': [{
'target_name': 'zlib',
'type': 'none',
'direct_dependent_settings': {
'targets': [
{
# Only used by win, down below.
'target_name' : 'zlib_x86_simd',
'type': 'static_library',
'cflags' : ['-msse4.2', '-mpclmul'],
'sources' : [
'../third_party/externals/zlib/crc_folding.c',
'../third_party/externals/zlib/fill_window_sse.c',
],
'conditions': [
[ 'skia_android_framework', { 'include_dirs': [ 'external/zlib' ] }],
[ 'skia_os == "mac" or skia_os == "ios"', {
# XCode needs and explicit file path, not a logical name like -lz.
'link_settings': { 'libraries': [ '$(SDKROOT)/usr/lib/libz.dylib' ] },
},{
'link_settings': { 'libraries': [ '-lz' ] },
}]
['skia_clang_build==1', {
'msvs_settings': {
'VCCLCompilerTool': {
'AdditionalOptions': [ '-msse4.2', '-mpclmul' ],
},
},
}],
],
},
{
'target_name': 'zlib',
'direct_dependent_settings': {
'conditions': [
[ 'skia_android_framework', { 'include_dirs': [ 'external/zlib' ] }],
[ 'skia_os == "mac" or skia_os == "ios"', {
# XCode needs and explicit file path, not a logical name like -lz.
'link_settings': { 'libraries': [ '$(SDKROOT)/usr/lib/libz.dylib' ] },
}],
[ 'skia_os not in ["mac", "ios", "win"]',{
'link_settings': { 'libraries': [ '-lz' ] },
}]
],
},
'conditions': [
[ 'skia_os != "win"', {
'type': 'none',
}, {
# win
'type': 'static_library',
'sources': [
'../third_party/externals/zlib/adler32.c',
'../third_party/externals/zlib/compress.c',
'../third_party/externals/zlib/crc32.c',
'../third_party/externals/zlib/crc32.h',
'../third_party/externals/zlib/deflate.c',
'../third_party/externals/zlib/deflate.h',
'../third_party/externals/zlib/gzclose.c',
'../third_party/externals/zlib/gzguts.h',
'../third_party/externals/zlib/gzlib.c',
'../third_party/externals/zlib/gzread.c',
'../third_party/externals/zlib/gzwrite.c',
'../third_party/externals/zlib/infback.c',
'../third_party/externals/zlib/inffast.c',
'../third_party/externals/zlib/inffast.h',
'../third_party/externals/zlib/inffixed.h',
'../third_party/externals/zlib/inflate.c',
'../third_party/externals/zlib/inflate.h',
'../third_party/externals/zlib/inftrees.c',
'../third_party/externals/zlib/inftrees.h',
'../third_party/externals/zlib/mozzconf.h',
'../third_party/externals/zlib/trees.c',
'../third_party/externals/zlib/trees.h',
'../third_party/externals/zlib/uncompr.c',
'../third_party/externals/zlib/x86.h',
'../third_party/externals/zlib/x86.c',
'../third_party/externals/zlib/zconf.h',
'../third_party/externals/zlib/zlib.h',
'../third_party/externals/zlib/zutil.c',
'../third_party/externals/zlib/zutil.h',
],
'include_dirs': [
'../third_party/externals/zlib/',
],
'direct_dependent_settings': {
'include_dirs': [
'../third_party/externals/zlib',
],
},
'dependencies': [
'zlib_x86_simd',
],
'defines': [
'_CRT_NONSTDC_NO_DEPRECATE',
],
}],
],
},
},{
'target_name': 'miniz',
'type': 'none',
'direct_dependent_settings': {
'include_dirs': [ '../third_party/miniz' ],
'defines': [ 'ZLIB_INCLUDE="miniz.c"' ],
# Not ideal, but GCC's issuing an otherwise-unstoppable (but innocuous) warning from miniz.c
'cflags': [ '-w' ],
},
}],
}

View File

@ -1,24 +0,0 @@
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
For more information, please refer to <http://unlicense.org/>

View File

@ -1,7 +0,0 @@
URL: https://code.google.com/p/miniz
Version: v115_r4
License: Unlicense
License File: LICENSE
Description: Single-file zlib-compatible compression library.
Local Modifications: Created LICENSE file for compliance purposes. Not included in original
distribution.

File diff suppressed because it is too large Load Diff