brettw@chromium.org | 069e2b8 | 2014-04-30 16:47:24 +0000 | [diff] [blame] | 1 | # Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 | # Use of this source code is governed by a BSD-style license that can be |
| 3 | # found in the LICENSE file. |
| 4 | |
Tomasz Śniatowski | abd5183 | 2019-06-24 17:52:19 +0000 | [diff] [blame] | 5 | import("//build/config/compiler/compiler.gni") |
| 6 | |
Adenilson Cavalcanti | 3060dcb | 2017-09-29 03:24:52 +0000 | [diff] [blame] | 7 | if (current_cpu == "arm" || current_cpu == "arm64") { |
| 8 | import("//build/config/arm.gni") |
| 9 | } |
| 10 | |
brettw@chromium.org | 069e2b8 | 2014-04-30 16:47:24 +0000 | [diff] [blame] | 11 | config("zlib_config") { |
| 12 | include_dirs = [ "." ] |
| 13 | } |
| 14 | |
Tom Anderson | 20c7ae1 | 2019-04-08 20:51:48 +0000 | [diff] [blame] | 15 | config("zlib_internal_config") { |
| 16 | defines = [ "ZLIB_IMPLEMENTATION" ] |
| 17 | } |
| 18 | |
Daniel Bratell | dde5ce5 | 2018-10-31 11:39:12 +0000 | [diff] [blame] | 19 | use_arm_neon_optimizations = false |
| 20 | if (current_cpu == "arm" || current_cpu == "arm64") { |
| 21 | if (arm_use_neon) { |
| 22 | use_arm_neon_optimizations = true |
| 23 | } |
| 24 | } |
| 25 | |
| 26 | use_x86_x64_optimizations = |
| 27 | (current_cpu == "x86" || current_cpu == "x64") && !is_ios |
| 28 | |
Noel Gordon | 17bbb3d | 2017-09-29 19:44:25 +0000 | [diff] [blame] | 29 | config("zlib_adler32_simd_config") { |
Daniel Bratell | dde5ce5 | 2018-10-31 11:39:12 +0000 | [diff] [blame] | 30 | if (use_x86_x64_optimizations) { |
Noel Gordon | 17bbb3d | 2017-09-29 19:44:25 +0000 | [diff] [blame] | 31 | defines = [ "ADLER32_SIMD_SSSE3" ] |
| 32 | } |
| 33 | |
Daniel Bratell | dde5ce5 | 2018-10-31 11:39:12 +0000 | [diff] [blame] | 34 | if (use_arm_neon_optimizations) { |
| 35 | defines = [ "ADLER32_SIMD_NEON" ] |
Noel Gordon | 17bbb3d | 2017-09-29 19:44:25 +0000 | [diff] [blame] | 36 | } |
| 37 | } |
| 38 | |
| 39 | source_set("zlib_adler32_simd") { |
| 40 | visibility = [ ":*" ] |
| 41 | |
Daniel Bratell | dde5ce5 | 2018-10-31 11:39:12 +0000 | [diff] [blame] | 42 | if (use_x86_x64_optimizations) { |
Noel Gordon | 17bbb3d | 2017-09-29 19:44:25 +0000 | [diff] [blame] | 43 | sources = [ |
| 44 | "adler32_simd.c", |
| 45 | "adler32_simd.h", |
| 46 | ] |
| 47 | |
| 48 | if (!is_win || is_clang) { |
| 49 | cflags = [ "-mssse3" ] |
| 50 | } |
| 51 | } |
| 52 | |
Daniel Bratell | dde5ce5 | 2018-10-31 11:39:12 +0000 | [diff] [blame] | 53 | if (use_arm_neon_optimizations) { |
| 54 | sources = [ |
| 55 | "adler32_simd.c", |
| 56 | "adler32_simd.h", |
| 57 | ] |
| 58 | if (!is_debug) { |
| 59 | # Use optimize_speed (-O3) to output the _smallest_ code. |
| 60 | configs -= [ "//build/config/compiler:default_optimization" ] |
| 61 | configs += [ "//build/config/compiler:optimize_speed" ] |
Noel Gordon | 17bbb3d | 2017-09-29 19:44:25 +0000 | [diff] [blame] | 62 | } |
| 63 | } |
| 64 | |
Tom Anderson | 20c7ae1 | 2019-04-08 20:51:48 +0000 | [diff] [blame] | 65 | configs += [ ":zlib_internal_config" ] |
| 66 | |
Noel Gordon | 17bbb3d | 2017-09-29 19:44:25 +0000 | [diff] [blame] | 67 | public_configs = [ ":zlib_adler32_simd_config" ] |
| 68 | } |
| 69 | |
Daniel Bratell | dde5ce5 | 2018-10-31 11:39:12 +0000 | [diff] [blame] | 70 | if (use_arm_neon_optimizations) { |
| 71 | config("zlib_arm_crc32_config") { |
Noel Gordon | 4bda75a | 2019-04-15 06:52:31 +0000 | [diff] [blame] | 72 | # Disabled for iPhone, as described in DDI0487C_a_armv8_arm: |
| 73 | # "All implementations of the ARMv8.1 architecture are required to |
| 74 | # implement the CRC32* instructions. These are optional in ARMv8.0." |
| 75 | if (!is_ios) { |
Adenilson Cavalcanti | 7235672 | 2018-02-16 03:41:14 +0000 | [diff] [blame] | 76 | defines = [ "CRC32_ARMV8_CRC32" ] |
| 77 | if (is_android) { |
| 78 | defines += [ "ARMV8_OS_ANDROID" ] |
| 79 | } else if (is_linux || is_chromeos) { |
| 80 | defines += [ "ARMV8_OS_LINUX" ] |
Noel Gordon | 4bda75a | 2019-04-15 06:52:31 +0000 | [diff] [blame] | 81 | } else if (is_fuchsia) { |
| 82 | defines += [ "ARMV8_OS_FUCHSIA" ] |
Richard Townsend | 8f2b9d4 | 2019-04-18 16:45:43 +0000 | [diff] [blame] | 83 | } else if (is_win) { |
| 84 | defines += [ "ARMV8_OS_WINDOWS" ] |
| 85 | } else { |
Noel Gordon | 4bda75a | 2019-04-15 06:52:31 +0000 | [diff] [blame] | 86 | assert(false, "Unsupported ARM OS") |
Adenilson Cavalcanti | 7235672 | 2018-02-16 03:41:14 +0000 | [diff] [blame] | 87 | } |
| 88 | } |
| 89 | } |
Adenilson Cavalcanti | 7235672 | 2018-02-16 03:41:14 +0000 | [diff] [blame] | 90 | |
Adenilson Cavalcanti | 7235672 | 2018-02-16 03:41:14 +0000 | [diff] [blame] | 91 | source_set("zlib_arm_crc32") { |
| 92 | visibility = [ ":*" ] |
| 93 | |
Jose Dapena Paz | bbacb13 | 2019-06-10 09:16:22 +0000 | [diff] [blame] | 94 | if (!is_ios) { |
Adenilson Cavalcanti | 7235672 | 2018-02-16 03:41:14 +0000 | [diff] [blame] | 95 | include_dirs = [ "." ] |
| 96 | |
| 97 | if (is_android) { |
| 98 | import("//build/config/android/config.gni") |
| 99 | if (defined(android_ndk_root) && android_ndk_root != "") { |
| 100 | deps = [ |
Sam Maier | 0044d04 | 2019-08-27 18:09:00 +0000 | [diff] [blame] | 101 | "//third_party/android_ndk:cpu_features", |
Adenilson Cavalcanti | 7235672 | 2018-02-16 03:41:14 +0000 | [diff] [blame] | 102 | ] |
Noel Gordon | 4bda75a | 2019-04-15 06:52:31 +0000 | [diff] [blame] | 103 | } else { |
| 104 | assert(false, "CPU detection requires the Android NDK") |
Adenilson Cavalcanti | 7235672 | 2018-02-16 03:41:14 +0000 | [diff] [blame] | 105 | } |
Jose Dapena Paz | bbacb13 | 2019-06-10 09:16:22 +0000 | [diff] [blame] | 106 | } else if (!is_win && !is_clang) { |
Tomasz Śniatowski | abd5183 | 2019-06-24 17:52:19 +0000 | [diff] [blame] | 107 | assert(!use_thin_lto, |
Jose Dapena Paz | bbacb13 | 2019-06-10 09:16:22 +0000 | [diff] [blame] | 108 | "ThinLTO fails mixing different module-level targets") |
| 109 | cflags_c = [ "-march=armv8-a+crc" ] |
Adenilson Cavalcanti | 7235672 | 2018-02-16 03:41:14 +0000 | [diff] [blame] | 110 | } |
| 111 | |
| 112 | sources = [ |
| 113 | "arm_features.c", |
| 114 | "arm_features.h", |
| 115 | "crc32_simd.c", |
| 116 | "crc32_simd.h", |
| 117 | ] |
| 118 | |
Adenilson Cavalcanti | 7235672 | 2018-02-16 03:41:14 +0000 | [diff] [blame] | 119 | if (!is_debug) { |
| 120 | configs -= [ "//build/config/compiler:default_optimization" ] |
| 121 | configs += [ "//build/config/compiler:optimize_speed" ] |
| 122 | } |
| 123 | } |
| 124 | |
Tom Anderson | 20c7ae1 | 2019-04-08 20:51:48 +0000 | [diff] [blame] | 125 | configs += [ ":zlib_internal_config" ] |
| 126 | |
Adenilson Cavalcanti | 7235672 | 2018-02-16 03:41:14 +0000 | [diff] [blame] | 127 | public_configs = [ ":zlib_arm_crc32_config" ] |
| 128 | } |
| 129 | } |
| 130 | |
Noel Gordon | 64ffef0 | 2017-12-08 11:39:34 +0000 | [diff] [blame] | 131 | config("zlib_inflate_chunk_simd_config") { |
Daniel Bratell | dde5ce5 | 2018-10-31 11:39:12 +0000 | [diff] [blame] | 132 | if (use_x86_x64_optimizations) { |
Noel Gordon | bedc29e | 2018-02-12 01:46:01 +0000 | [diff] [blame] | 133 | defines = [ "INFLATE_CHUNK_SIMD_SSE2" ] |
| 134 | |
| 135 | if (current_cpu == "x64") { |
| 136 | defines += [ "INFLATE_CHUNK_READ_64LE" ] |
| 137 | } |
Noel Gordon | 64ffef0 | 2017-12-08 11:39:34 +0000 | [diff] [blame] | 138 | } |
| 139 | |
Daniel Bratell | dde5ce5 | 2018-10-31 11:39:12 +0000 | [diff] [blame] | 140 | if (use_arm_neon_optimizations) { |
| 141 | defines = [ "INFLATE_CHUNK_SIMD_NEON" ] |
Adenilson Cavalcanti | 9972c36 | 2019-01-31 21:39:02 +0000 | [diff] [blame] | 142 | if (current_cpu == "arm64") { |
| 143 | defines += [ "INFLATE_CHUNK_READ_64LE" ] |
| 144 | } |
Noel Gordon | 64ffef0 | 2017-12-08 11:39:34 +0000 | [diff] [blame] | 145 | } |
| 146 | } |
| 147 | |
| 148 | source_set("zlib_inflate_chunk_simd") { |
| 149 | visibility = [ ":*" ] |
| 150 | |
Daniel Bratell | dde5ce5 | 2018-10-31 11:39:12 +0000 | [diff] [blame] | 151 | if (use_x86_x64_optimizations || use_arm_neon_optimizations) { |
Noel Gordon | 64ffef0 | 2017-12-08 11:39:34 +0000 | [diff] [blame] | 152 | include_dirs = [ "." ] |
| 153 | |
| 154 | sources = [ |
| 155 | "contrib/optimizations/chunkcopy.h", |
| 156 | "contrib/optimizations/inffast_chunk.c", |
| 157 | "contrib/optimizations/inffast_chunk.h", |
| 158 | "contrib/optimizations/inflate.c", |
| 159 | ] |
Noel Gordon | 64ffef0 | 2017-12-08 11:39:34 +0000 | [diff] [blame] | 160 | |
Daniel Bratell | dde5ce5 | 2018-10-31 11:39:12 +0000 | [diff] [blame] | 161 | if (use_arm_neon_optimizations && !is_debug) { |
| 162 | # Here we trade better performance on newer/bigger ARMv8 cores |
Noel Gordon | 4bda75a | 2019-04-15 06:52:31 +0000 | [diff] [blame] | 163 | # for less perf on ARMv7, per crbug.com/772870#c40 |
Daniel Bratell | dde5ce5 | 2018-10-31 11:39:12 +0000 | [diff] [blame] | 164 | configs -= [ "//build/config/compiler:default_optimization" ] |
| 165 | configs += [ "//build/config/compiler:optimize_speed" ] |
Noel Gordon | 64ffef0 | 2017-12-08 11:39:34 +0000 | [diff] [blame] | 166 | } |
| 167 | } |
| 168 | |
| 169 | configs -= [ "//build/config/compiler:chromium_code" ] |
Tom Anderson | 20c7ae1 | 2019-04-08 20:51:48 +0000 | [diff] [blame] | 170 | configs += [ |
| 171 | ":zlib_internal_config", |
| 172 | "//build/config/compiler:no_chromium_code", |
| 173 | ] |
Noel Gordon | 64ffef0 | 2017-12-08 11:39:34 +0000 | [diff] [blame] | 174 | |
| 175 | public_configs = [ ":zlib_inflate_chunk_simd_config" ] |
| 176 | } |
| 177 | |
Noel Gordon | 8e904b3 | 2018-01-04 12:10:08 +1100 | [diff] [blame] | 178 | config("zlib_crc32_simd_config") { |
Daniel Bratell | dde5ce5 | 2018-10-31 11:39:12 +0000 | [diff] [blame] | 179 | if (use_x86_x64_optimizations) { |
Noel Gordon | 8e904b3 | 2018-01-04 12:10:08 +1100 | [diff] [blame] | 180 | defines = [ "CRC32_SIMD_SSE42_PCLMUL" ] |
| 181 | } |
| 182 | } |
| 183 | |
| 184 | source_set("zlib_crc32_simd") { |
| 185 | visibility = [ ":*" ] |
| 186 | |
Daniel Bratell | dde5ce5 | 2018-10-31 11:39:12 +0000 | [diff] [blame] | 187 | if (use_x86_x64_optimizations) { |
Noel Gordon | 8e904b3 | 2018-01-04 12:10:08 +1100 | [diff] [blame] | 188 | sources = [ |
| 189 | "crc32_simd.c", |
| 190 | "crc32_simd.h", |
| 191 | ] |
| 192 | |
| 193 | if (!is_win || is_clang) { |
| 194 | cflags = [ |
| 195 | "-msse4.2", |
| 196 | "-mpclmul", |
| 197 | ] |
| 198 | } |
| 199 | } |
| 200 | |
Tom Anderson | 20c7ae1 | 2019-04-08 20:51:48 +0000 | [diff] [blame] | 201 | configs += [ ":zlib_internal_config" ] |
| 202 | |
Noel Gordon | 8e904b3 | 2018-01-04 12:10:08 +1100 | [diff] [blame] | 203 | public_configs = [ ":zlib_crc32_simd_config" ] |
| 204 | } |
| 205 | |
Tom Anderson | 20c7ae1 | 2019-04-08 20:51:48 +0000 | [diff] [blame] | 206 | source_set("zlib_x86_simd") { |
Noel Gordon | 8e904b3 | 2018-01-04 12:10:08 +1100 | [diff] [blame] | 207 | visibility = [ ":*" ] |
| 208 | |
Daniel Bratell | dde5ce5 | 2018-10-31 11:39:12 +0000 | [diff] [blame] | 209 | if (use_x86_x64_optimizations) { |
scottmg | b8135bf | 2014-12-02 23:28:00 -0800 | [diff] [blame] | 210 | sources = [ |
| 211 | "crc_folding.c", |
| 212 | "fill_window_sse.c", |
| 213 | ] |
Noel Gordon | 8e904b3 | 2018-01-04 12:10:08 +1100 | [diff] [blame] | 214 | |
Nico Weber | 0f60cc5 | 2014-11-18 15:21:17 -0800 | [diff] [blame] | 215 | if (!is_win || is_clang) { |
scottmg | b8135bf | 2014-12-02 23:28:00 -0800 | [diff] [blame] | 216 | cflags = [ |
| 217 | "-msse4.2", |
| 218 | "-mpclmul", |
| 219 | ] |
Nico Weber | 0f60cc5 | 2014-11-18 15:21:17 -0800 | [diff] [blame] | 220 | } |
robert.bradford | 10dd686 | 2014-11-05 06:59:34 -0800 | [diff] [blame] | 221 | } else { |
scottmg | b8135bf | 2014-12-02 23:28:00 -0800 | [diff] [blame] | 222 | sources = [ |
| 223 | "simd_stub.c", |
| 224 | ] |
robert.bradford | 10dd686 | 2014-11-05 06:59:34 -0800 | [diff] [blame] | 225 | } |
dpranke | 7363615 | 2014-11-17 17:54:55 -0800 | [diff] [blame] | 226 | |
| 227 | configs -= [ "//build/config/compiler:chromium_code" ] |
Tom Anderson | 20c7ae1 | 2019-04-08 20:51:48 +0000 | [diff] [blame] | 228 | configs += [ |
| 229 | ":zlib_internal_config", |
| 230 | "//build/config/compiler:no_chromium_code", |
| 231 | ] |
robert.bradford | 10dd686 | 2014-11-05 06:59:34 -0800 | [diff] [blame] | 232 | } |
| 233 | |
brettw | 3f3d126 | 2015-09-02 10:57:05 -0700 | [diff] [blame] | 234 | config("zlib_warnings") { |
Daniel Bratell | dde5ce5 | 2018-10-31 11:39:12 +0000 | [diff] [blame] | 235 | if (is_clang && use_x86_x64_optimizations) { |
brettw | 3f3d126 | 2015-09-02 10:57:05 -0700 | [diff] [blame] | 236 | cflags = [ "-Wno-incompatible-pointer-types" ] |
| 237 | } |
| 238 | } |
| 239 | |
Tom Anderson | 20c7ae1 | 2019-04-08 20:51:48 +0000 | [diff] [blame] | 240 | component("zlib") { |
brettw@chromium.org | 069e2b8 | 2014-04-30 16:47:24 +0000 | [diff] [blame] | 241 | if (!is_win) { |
| 242 | # Don't stomp on "libzlib" on other platforms. |
| 243 | output_name = "chrome_zlib" |
| 244 | } |
| 245 | |
| 246 | sources = [ |
| 247 | "adler32.c", |
Tom Anderson | 20c7ae1 | 2019-04-08 20:51:48 +0000 | [diff] [blame] | 248 | "chromeconf.h", |
brettw@chromium.org | 069e2b8 | 2014-04-30 16:47:24 +0000 | [diff] [blame] | 249 | "compress.c", |
| 250 | "crc32.c", |
| 251 | "crc32.h", |
| 252 | "deflate.c", |
| 253 | "deflate.h", |
| 254 | "gzclose.c", |
| 255 | "gzguts.h", |
| 256 | "gzlib.c", |
| 257 | "gzread.c", |
| 258 | "gzwrite.c", |
| 259 | "infback.c", |
| 260 | "inffast.c", |
| 261 | "inffast.h", |
| 262 | "inffixed.h", |
brettw@chromium.org | 069e2b8 | 2014-04-30 16:47:24 +0000 | [diff] [blame] | 263 | "inflate.h", |
| 264 | "inftrees.c", |
| 265 | "inftrees.h", |
brettw@chromium.org | 069e2b8 | 2014-04-30 16:47:24 +0000 | [diff] [blame] | 266 | "trees.c", |
| 267 | "trees.h", |
| 268 | "uncompr.c", |
robert.bradford | 10dd686 | 2014-11-05 06:59:34 -0800 | [diff] [blame] | 269 | "x86.h", |
brettw@chromium.org | 069e2b8 | 2014-04-30 16:47:24 +0000 | [diff] [blame] | 270 | "zconf.h", |
| 271 | "zlib.h", |
| 272 | "zutil.c", |
| 273 | "zutil.h", |
| 274 | ] |
| 275 | |
Boris Sazonov | 0f473a1 | 2017-11-30 10:01:30 +0000 | [diff] [blame] | 276 | defines = [] |
| 277 | deps = [] |
| 278 | |
Daniel Bratell | dde5ce5 | 2018-10-31 11:39:12 +0000 | [diff] [blame] | 279 | if (use_x86_x64_optimizations || use_arm_neon_optimizations) { |
| 280 | deps += [ |
| 281 | ":zlib_adler32_simd", |
| 282 | ":zlib_inflate_chunk_simd", |
| 283 | ] |
Noel Gordon | 8e904b3 | 2018-01-04 12:10:08 +1100 | [diff] [blame] | 284 | |
Daniel Bratell | dde5ce5 | 2018-10-31 11:39:12 +0000 | [diff] [blame] | 285 | if (use_x86_x64_optimizations) { |
| 286 | sources += [ "x86.c" ] |
| 287 | deps += [ ":zlib_crc32_simd" ] |
| 288 | } else if (use_arm_neon_optimizations) { |
Adenilson Cavalcanti | d6d1961 | 2018-08-07 16:08:59 +0000 | [diff] [blame] | 289 | sources += [ "contrib/optimizations/slide_hash_neon.h" ] |
Daniel Bratell | dde5ce5 | 2018-10-31 11:39:12 +0000 | [diff] [blame] | 290 | deps += [ ":zlib_arm_crc32" ] |
Noel Gordon | 17bbb3d | 2017-09-29 19:44:25 +0000 | [diff] [blame] | 291 | } |
Daniel Bratell | dde5ce5 | 2018-10-31 11:39:12 +0000 | [diff] [blame] | 292 | } else { |
| 293 | sources += [ "inflate.c" ] |
robert.bradford | 10dd686 | 2014-11-05 06:59:34 -0800 | [diff] [blame] | 294 | } |
| 295 | |
brettw@chromium.org | 069e2b8 | 2014-04-30 16:47:24 +0000 | [diff] [blame] | 296 | configs -= [ "//build/config/compiler:chromium_code" ] |
brettw | 3f3d126 | 2015-09-02 10:57:05 -0700 | [diff] [blame] | 297 | configs += [ |
Tom Anderson | 20c7ae1 | 2019-04-08 20:51:48 +0000 | [diff] [blame] | 298 | ":zlib_internal_config", |
brettw | 3f3d126 | 2015-09-02 10:57:05 -0700 | [diff] [blame] | 299 | "//build/config/compiler:no_chromium_code", |
| 300 | |
| 301 | # Must be after no_chromium_code for warning flags to be ordered correctly. |
| 302 | ":zlib_warnings", |
| 303 | ] |
brettw@chromium.org | 069e2b8 | 2014-04-30 16:47:24 +0000 | [diff] [blame] | 304 | |
Brett Wilson | 9bdea3f | 2014-09-23 16:41:46 -0700 | [diff] [blame] | 305 | public_configs = [ ":zlib_config" ] |
Noel Gordon | 17bbb3d | 2017-09-29 19:44:25 +0000 | [diff] [blame] | 306 | |
Adenilson Cavalcanti | f44229b | 2017-10-30 18:39:29 +0000 | [diff] [blame] | 307 | deps += [ ":zlib_x86_simd" ] |
Daniel Bratell | dde5ce5 | 2018-10-31 11:39:12 +0000 | [diff] [blame] | 308 | allow_circular_includes_from = deps |
brettw@chromium.org | 069e2b8 | 2014-04-30 16:47:24 +0000 | [diff] [blame] | 309 | } |
| 310 | |
brettw | 3f3d126 | 2015-09-02 10:57:05 -0700 | [diff] [blame] | 311 | config("minizip_warnings") { |
| 312 | visibility = [ ":*" ] |
Noel Gordon | 71eb81f | 2018-02-12 08:15:47 +0000 | [diff] [blame] | 313 | |
brettw | 3f3d126 | 2015-09-02 10:57:05 -0700 | [diff] [blame] | 314 | if (is_clang) { |
| 315 | # zlib uses `if ((a == b))` for some reason. |
| 316 | cflags = [ "-Wno-parentheses-equality" ] |
| 317 | } |
| 318 | } |
| 319 | |
brettw@chromium.org | 069e2b8 | 2014-04-30 16:47:24 +0000 | [diff] [blame] | 320 | static_library("minizip") { |
| 321 | sources = [ |
| 322 | "contrib/minizip/ioapi.c", |
| 323 | "contrib/minizip/ioapi.h", |
| 324 | "contrib/minizip/iowin32.c", |
| 325 | "contrib/minizip/iowin32.h", |
| 326 | "contrib/minizip/unzip.c", |
| 327 | "contrib/minizip/unzip.h", |
| 328 | "contrib/minizip/zip.c", |
| 329 | "contrib/minizip/zip.h", |
| 330 | ] |
| 331 | |
| 332 | if (!is_win) { |
| 333 | sources -= [ |
| 334 | "contrib/minizip/iowin32.c", |
| 335 | "contrib/minizip/iowin32.h", |
| 336 | ] |
| 337 | } |
Noel Gordon | 71eb81f | 2018-02-12 08:15:47 +0000 | [diff] [blame] | 338 | |
takise | b399410 | 2017-04-06 22:48:40 -0700 | [diff] [blame] | 339 | if (is_mac || is_ios || is_android || is_nacl) { |
brettw@chromium.org | 069e2b8 | 2014-04-30 16:47:24 +0000 | [diff] [blame] | 340 | # Mac, Android and the BSDs don't have fopen64, ftello64, or fseeko64. We |
| 341 | # use fopen, ftell, and fseek instead on these systems. |
| 342 | defines = [ "USE_FILE32API" ] |
| 343 | } |
| 344 | |
scottmg | b8135bf | 2014-12-02 23:28:00 -0800 | [diff] [blame] | 345 | deps = [ |
| 346 | ":zlib", |
| 347 | ] |
brettw@chromium.org | 069e2b8 | 2014-04-30 16:47:24 +0000 | [diff] [blame] | 348 | |
| 349 | configs -= [ "//build/config/compiler:chromium_code" ] |
brettw | 3f3d126 | 2015-09-02 10:57:05 -0700 | [diff] [blame] | 350 | configs += [ |
| 351 | "//build/config/compiler:no_chromium_code", |
| 352 | |
| 353 | # Must be after no_chromium_code for warning flags to be ordered correctly. |
| 354 | ":minizip_warnings", |
| 355 | ] |
Noel Gordon | 17bbb3d | 2017-09-29 19:44:25 +0000 | [diff] [blame] | 356 | |
Brett Wilson | 9bdea3f | 2014-09-23 16:41:46 -0700 | [diff] [blame] | 357 | public_configs = [ ":zlib_config" ] |
brettw@chromium.org | 069e2b8 | 2014-04-30 16:47:24 +0000 | [diff] [blame] | 358 | } |
Noel Gordon | c83e216 | 2018-01-21 11:19:12 +0000 | [diff] [blame] | 359 | |
| 360 | executable("zlib_bench") { |
| 361 | include_dirs = [ "." ] |
| 362 | |
| 363 | sources = [ |
| 364 | "contrib/bench/zlib_bench.cc", |
| 365 | ] |
| 366 | |
| 367 | if (!is_debug) { |
| 368 | configs -= [ "//build/config/compiler:default_optimization" ] |
| 369 | configs += [ "//build/config/compiler:optimize_speed" ] |
| 370 | } |
| 371 | |
| 372 | configs -= [ "//build/config/compiler:chromium_code" ] |
| 373 | configs += [ "//build/config/compiler:no_chromium_code" ] |
| 374 | |
| 375 | deps = [ |
Noel Gordon | bedc29e | 2018-02-12 01:46:01 +0000 | [diff] [blame] | 376 | ":zlib", |
Noel Gordon | c83e216 | 2018-01-21 11:19:12 +0000 | [diff] [blame] | 377 | ] |
| 378 | } |