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