[Session restore] Rename group name Enabled to Restore.
[chromium-blink-merge.git] / third_party / zlib / BUILD.gn
blob1cea9acb9835b079bf3e9f7e34eb3fa773b63af3
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.
5 config("zlib_config") {
6   include_dirs = [ "." ]
9 static_library("zlib_x86_simd") {
10   if (!is_ios && (current_cpu == "x86" || current_cpu == "x64")) {
11     sources = [
12       "crc_folding.c",
13       "fill_window_sse.c",
14     ]
15     if (!is_win || is_clang) {
16       cflags = [
17         "-msse4.2",
18         "-mpclmul",
19       ]
20     }
21   } else {
22     sources = [
23       "simd_stub.c",
24     ]
25   }
27   configs -= [ "//build/config/compiler:chromium_code" ]
28   configs += [ "//build/config/compiler:no_chromium_code" ]
31 static_library("zlib") {
32   if (!is_win) {
33     # Don't stomp on "libzlib" on other platforms.
34     output_name = "chrome_zlib"
35   }
37   sources = [
38     "adler32.c",
39     "compress.c",
40     "crc32.c",
41     "crc32.h",
42     "deflate.c",
43     "deflate.h",
44     "gzclose.c",
45     "gzguts.h",
46     "gzlib.c",
47     "gzread.c",
48     "gzwrite.c",
49     "infback.c",
50     "inffast.c",
51     "inffast.h",
52     "inffixed.h",
53     "inflate.c",
54     "inflate.h",
55     "inftrees.c",
56     "inftrees.h",
57     "mozzconf.h",
58     "trees.c",
59     "trees.h",
60     "uncompr.c",
61     "x86.h",
62     "zconf.h",
63     "zlib.h",
64     "zutil.c",
65     "zutil.h",
66   ]
68   if (!is_ios && (current_cpu == "x86" || current_cpu == "x64")) {
69     sources += [ "x86.c" ]
70   }
72   configs -= [ "//build/config/compiler:chromium_code" ]
73   configs += [ "//build/config/compiler:no_chromium_code" ]
75   public_configs = [ ":zlib_config" ]
76   deps = [
77     ":zlib_x86_simd",
78   ]
81 static_library("minizip") {
82   sources = [
83     "contrib/minizip/ioapi.c",
84     "contrib/minizip/ioapi.h",
85     "contrib/minizip/iowin32.c",
86     "contrib/minizip/iowin32.h",
87     "contrib/minizip/unzip.c",
88     "contrib/minizip/unzip.h",
89     "contrib/minizip/zip.c",
90     "contrib/minizip/zip.h",
91   ]
93   if (!is_win) {
94     sources -= [
95       "contrib/minizip/iowin32.c",
96       "contrib/minizip/iowin32.h",
97     ]
98   }
99   if (is_mac || is_ios || is_android) {
100     # Mac, Android and the BSDs don't have fopen64, ftello64, or fseeko64. We
101     # use fopen, ftell, and fseek instead on these systems.
102     defines = [ "USE_FILE32API" ]
103   }
105   if (is_clang) {
106     # zlib uses `if ((a == b))` for some reason.
107     cflags = [ "-Wno-parentheses-equality" ]
108   }
110   deps = [
111     ":zlib",
112   ]
114   configs -= [ "//build/config/compiler:chromium_code" ]
115   configs += [ "//build/config/compiler:no_chromium_code" ]
116   public_configs = [ ":zlib_config" ]
119 static_library("zip") {
120   sources = [
121     "google/zip.cc",
122     "google/zip.h",
123     "google/zip_internal.cc",
124     "google/zip_internal.h",
125     "google/zip_reader.cc",
126     "google/zip_reader.h",
127   ]
128   deps = [
129     ":minizip",
130     "//base",
131   ]