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
5config("zlib_config") {
6  include_dirs = [ "." ]
7}
8
9static_library("zlib") {
10  if (!is_win) {
11    # Don't stomp on "libzlib" on other platforms.
12    output_name = "chrome_zlib"
13  }
14
15  sources = [
16    "adler32.c",
17    "compress.c",
18    "crc32.c",
19    "crc32.h",
20    "deflate.c",
21    "deflate.h",
22    "gzclose.c",
23    "gzguts.h",
24    "gzlib.c",
25    "gzread.c",
26    "gzwrite.c",
27    "infback.c",
28    "inffast.c",
29    "inffast.h",
30    "inffixed.h",
31    "inflate.c",
32    "inflate.h",
33    "inftrees.c",
34    "inftrees.h",
35    "mozzconf.h",
36    "trees.c",
37    "trees.h",
38    "uncompr.c",
39    "zconf.h",
40    "zlib.h",
41    "zutil.c",
42    "zutil.h",
43  ]
44
45  configs -= [ "//build/config/compiler:chromium_code" ]
46  configs += [ "//build/config/compiler:no_chromium_code" ]
47
48  public_configs = [ ":zlib_config" ]
49}
50
51static_library("minizip") {
52  sources = [
53    "contrib/minizip/ioapi.c",
54    "contrib/minizip/ioapi.h",
55    "contrib/minizip/iowin32.c",
56    "contrib/minizip/iowin32.h",
57    "contrib/minizip/unzip.c",
58    "contrib/minizip/unzip.h",
59    "contrib/minizip/zip.c",
60    "contrib/minizip/zip.h",
61  ]
62
63  if (!is_win) {
64    sources -= [
65      "contrib/minizip/iowin32.c",
66      "contrib/minizip/iowin32.h",
67    ]
68  }
69  if (is_mac || is_ios || is_android) {
70    # Mac, Android and the BSDs don't have fopen64, ftello64, or fseeko64. We
71    # use fopen, ftell, and fseek instead on these systems.
72    defines = [ "USE_FILE32API" ]
73  }
74
75  if (is_clang) {
76    # zlib uses `if ((a == b))` for some reason.
77    cflags = [ "-Wno-parentheses-equality" ]
78  }
79
80  deps = [ ":zlib" ]
81
82  configs -= [ "//build/config/compiler:chromium_code" ]
83  configs += [ "//build/config/compiler:no_chromium_code" ]
84  public_configs = [ ":zlib_config" ]
85}
86
87static_library("zip") {
88  sources = [
89    "google/zip.cc",
90    "google/zip.h",
91    "google/zip_internal.cc",
92    "google/zip_internal.h",
93    "google/zip_reader.cc",
94    "google/zip_reader.h",
95  ]
96  deps = [
97    ":minizip",
98    "//base",
99  ]
100}
101