| OLD | NEW |
| 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 { | 5 { |
| 6 'variables': { | |
| 7 'conditions': [ | |
| 8 [ 'OS=="none"', { | |
| 9 # Because we have a patched zlib, we cannot use the system libz. | |
| 10 # TODO(pvalchev): OpenBSD is purposefully left out, as the system | |
| 11 # zlib brings up an incompatibility that breaks rendering. | |
| 12 'use_system_zlib%': 1, | |
| 13 }, { | |
| 14 'use_system_zlib%': 0, | |
| 15 }], | |
| 16 ], | |
| 17 'use_system_minizip%': 0, | |
| 18 }, | |
| 19 'targets': [ | 6 'targets': [ |
| 20 { | 7 { |
| 21 'target_name': 'zlib', | 8 'target_name': 'zlib', |
| 22 'type': 'static_library', | 9 'type': 'static_library', |
| 10 'sources': [ |
| 11 'adler32.c', |
| 12 'compress.c', |
| 13 'crc32.c', |
| 14 'crc32.h', |
| 15 'deflate.c', |
| 16 'deflate.h', |
| 17 'gzclose.c', |
| 18 'gzguts.h', |
| 19 'gzlib.c', |
| 20 'gzread.c', |
| 21 'gzwrite.c', |
| 22 'infback.c', |
| 23 'inffast.c', |
| 24 'inffast.h', |
| 25 'inffixed.h', |
| 26 'inflate.c', |
| 27 'inflate.h', |
| 28 'inftrees.c', |
| 29 'inftrees.h', |
| 30 'mozzconf.h', |
| 31 'trees.c', |
| 32 'trees.h', |
| 33 'uncompr.c', |
| 34 'zconf.h', |
| 35 'zlib.h', |
| 36 'zutil.c', |
| 37 'zutil.h', |
| 38 ], |
| 39 'include_dirs': [ |
| 40 '.', |
| 41 ], |
| 42 'direct_dependent_settings': { |
| 43 'include_dirs': [ |
| 44 '.', |
| 45 ], |
| 46 }, |
| 23 'conditions': [ | 47 'conditions': [ |
| 24 ['use_system_zlib==0', { | 48 ['OS!="win"', { |
| 25 'sources': [ | 49 'product_name': 'chrome_zlib', |
| 26 'adler32.c', | 50 }], ['OS=="android"', { |
| 27 'compress.c', | 51 'toolsets': ['target', 'host'], |
| 28 'crc32.c', | |
| 29 'crc32.h', | |
| 30 'deflate.c', | |
| 31 'deflate.h', | |
| 32 'gzclose.c', | |
| 33 'gzguts.h', | |
| 34 'gzlib.c', | |
| 35 'gzread.c', | |
| 36 'gzwrite.c', | |
| 37 'infback.c', | |
| 38 'inffast.c', | |
| 39 'inffast.h', | |
| 40 'inffixed.h', | |
| 41 'inflate.c', | |
| 42 'inflate.h', | |
| 43 'inftrees.c', | |
| 44 'inftrees.h', | |
| 45 'mozzconf.h', | |
| 46 'trees.c', | |
| 47 'trees.h', | |
| 48 'uncompr.c', | |
| 49 'zconf.h', | |
| 50 'zlib.h', | |
| 51 'zutil.c', | |
| 52 'zutil.h', | |
| 53 ], | |
| 54 'include_dirs': [ | |
| 55 '.', | |
| 56 ], | |
| 57 'direct_dependent_settings': { | |
| 58 'include_dirs': [ | |
| 59 '.', | |
| 60 ], | |
| 61 }, | |
| 62 'conditions': [ | |
| 63 ['OS!="win"', { | |
| 64 'product_name': 'chrome_zlib', | |
| 65 }], ['OS=="android"', { | |
| 66 'toolsets': ['target', 'host'], | |
| 67 }], | |
| 68 ], | |
| 69 }, { | |
| 70 'variables': { | |
| 71 'headers_root_path': '.', | |
| 72 'header_filenames': [ | |
| 73 'zlib.h', | |
| 74 ], | |
| 75 }, | |
| 76 'includes': [ | |
| 77 '../../build/shim_headers.gypi', | |
| 78 ], | |
| 79 'direct_dependent_settings': { | |
| 80 'defines': [ | |
| 81 'USE_SYSTEM_ZLIB', | |
| 82 ], | |
| 83 }, | |
| 84 'link_settings': { | |
| 85 'libraries': [ | |
| 86 '-lz', | |
| 87 ], | |
| 88 }, | |
| 89 }], | 52 }], |
| 90 ], | 53 ], |
| 91 }, | 54 }, |
| 92 { | 55 { |
| 93 'target_name': 'minizip', | 56 'target_name': 'minizip', |
| 94 'type': 'static_library', | 57 'type': 'static_library', |
| 58 'sources': [ |
| 59 'contrib/minizip/ioapi.c', |
| 60 'contrib/minizip/ioapi.h', |
| 61 'contrib/minizip/iowin32.c', |
| 62 'contrib/minizip/iowin32.h', |
| 63 'contrib/minizip/unzip.c', |
| 64 'contrib/minizip/unzip.h', |
| 65 'contrib/minizip/zip.c', |
| 66 'contrib/minizip/zip.h', |
| 67 ], |
| 68 'dependencies': [ |
| 69 'zlib', |
| 70 ], |
| 71 'include_dirs': [ |
| 72 '.', |
| 73 '../..', |
| 74 ], |
| 75 'direct_dependent_settings': { |
| 76 'include_dirs': [ |
| 77 '.', |
| 78 ], |
| 79 }, |
| 95 'conditions': [ | 80 'conditions': [ |
| 96 ['use_system_minizip==0', { | 81 ['OS!="win"', { |
| 97 'sources': [ | 82 'sources!': [ |
| 98 'contrib/minizip/ioapi.c', | 83 'contrib/minizip/iowin32.c' |
| 99 'contrib/minizip/ioapi.h', | |
| 100 'contrib/minizip/iowin32.c', | |
| 101 'contrib/minizip/iowin32.h', | |
| 102 'contrib/minizip/unzip.c', | |
| 103 'contrib/minizip/unzip.h', | |
| 104 'contrib/minizip/zip.c', | |
| 105 'contrib/minizip/zip.h', | |
| 106 ], | 84 ], |
| 107 'dependencies': [ | 85 }], |
| 108 'zlib', | 86 ['OS=="android"', { |
| 109 ], | 87 'toolsets': ['target', 'host'], |
| 110 'include_dirs': [ | |
| 111 '.', | |
| 112 '../..', | |
| 113 ], | |
| 114 'direct_dependent_settings': { | |
| 115 'include_dirs': [ | |
| 116 '.', | |
| 117 ], | |
| 118 }, | |
| 119 'conditions': [ | |
| 120 ['OS!="win"', { | |
| 121 'sources!': [ | |
| 122 'contrib/minizip/iowin32.c' | |
| 123 ], | |
| 124 }], | |
| 125 ['OS=="android"', { | |
| 126 'toolsets': ['target', 'host'], | |
| 127 }], | |
| 128 ], | |
| 129 }, { | |
| 130 'all_dependent_settings': { | |
| 131 'defines': [ | |
| 132 'USE_SYSTEM_MINIZIP', | |
| 133 ], | |
| 134 }, | |
| 135 'defines': [ | |
| 136 'USE_SYSTEM_MINIZIP', | |
| 137 ], | |
| 138 'link_settings': { | |
| 139 'libraries': [ | |
| 140 '-lminizip', | |
| 141 ], | |
| 142 }, | |
| 143 }], | 88 }], |
| 144 ['OS=="mac" or OS=="ios" or os_bsd==1 or OS=="android"', { | 89 ['OS=="mac" or OS=="ios" or os_bsd==1 or OS=="android"', { |
| 145 # Mac, Android and the BSDs don't have fopen64, ftello64, or | 90 # Mac, Android and the BSDs don't have fopen64, ftello64, or |
| 146 # fseeko64. We use fopen, ftell, and fseek instead on these | 91 # fseeko64. We use fopen, ftell, and fseek instead on these |
| 147 # systems. | 92 # systems. |
| 148 'defines': [ | 93 'defines': [ |
| 149 'USE_FILE32API' | 94 'USE_FILE32API' |
| 150 ], | 95 ], |
| 151 }], | 96 }], |
| 152 ['clang==1', { | 97 ['clang==1', { |
| 153 'xcode_settings': { | 98 'xcode_settings': { |
| 154 'WARNING_CFLAGS': [ | 99 'WARNING_CFLAGS': [ |
| 155 # zlib uses `if ((a == b))` for some reason. | 100 # zlib uses `if ((a == b))` for some reason. |
| 156 '-Wno-parentheses-equality', | 101 '-Wno-parentheses-equality', |
| 157 ], | 102 ], |
| 158 }, | 103 }, |
| 159 'cflags': [ | 104 'cflags': [ |
| 160 '-Wno-parentheses-equality', | 105 '-Wno-parentheses-equality', |
| 161 ], | 106 ], |
| 162 }], | 107 }], |
| 163 ], | 108 ], |
| 164 } | 109 } |
| 165 ], | 110 ], |
| 166 } | 111 } |
| OLD | NEW |