cygprofile: increase timeouts to allow showing web contents
[chromium-blink-merge.git] / third_party / zlib / BUILD.gn
blob161d4f56aa3726f8ff8351ee260f36f8f982450f
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 config("zlib_warnings") {
32   if (is_clang && !is_ios &&
33       (current_cpu == "x86" || current_cpu == "x64")) {
34     cflags = [ "-Wno-incompatible-pointer-types" ]
35   }
38 static_library("zlib") {
39   if (!is_win) {
40     # Don't stomp on "libzlib" on other platforms.
41     output_name = "chrome_zlib"
42   }
44   sources = [
45     "adler32.c",
46     "compress.c",
47     "crc32.c",
48     "crc32.h",
49     "deflate.c",
50     "deflate.h",
51     "gzclose.c",
52     "gzguts.h",
53     "gzlib.c",
54     "gzread.c",
55     "gzwrite.c",
56     "infback.c",
57     "inffast.c",
58     "inffast.h",
59     "inffixed.h",
60     "inflate.c",
61     "inflate.h",
62     "inftrees.c",
63     "inftrees.h",
64     "mozzconf.h",
65     "trees.c",
66     "trees.h",
67     "uncompr.c",
68     "x86.h",
69     "zconf.h",
70     "zlib.h",
71     "zutil.c",
72     "zutil.h",
73   ]
75   if (!is_ios && (current_cpu == "x86" || current_cpu == "x64")) {
76     sources += [ "x86.c" ]
77   }
79   configs -= [ "//build/config/compiler:chromium_code" ]
80   configs += [
81     "//build/config/compiler:no_chromium_code",
83     # Must be after no_chromium_code for warning flags to be ordered correctly.
84     ":zlib_warnings",
85   ]
87   public_configs = [ ":zlib_config" ]
88   deps = [
89     ":zlib_x86_simd",
90   ]
93 config("minizip_warnings") {
94   visibility = [ ":*" ]
95   if (is_clang) {
96     # zlib uses `if ((a == b))` for some reason.
97     cflags = [ "-Wno-parentheses-equality" ]
98   }
101 static_library("minizip") {
102   sources = [
103     "contrib/minizip/ioapi.c",
104     "contrib/minizip/ioapi.h",
105     "contrib/minizip/iowin32.c",
106     "contrib/minizip/iowin32.h",
107     "contrib/minizip/unzip.c",
108     "contrib/minizip/unzip.h",
109     "contrib/minizip/zip.c",
110     "contrib/minizip/zip.h",
111   ]
113   if (!is_win) {
114     sources -= [
115       "contrib/minizip/iowin32.c",
116       "contrib/minizip/iowin32.h",
117     ]
118   }
119   if (is_mac || is_ios || is_android) {
120     # Mac, Android and the BSDs don't have fopen64, ftello64, or fseeko64. We
121     # use fopen, ftell, and fseek instead on these systems.
122     defines = [ "USE_FILE32API" ]
123   }
125   deps = [
126     ":zlib",
127   ]
129   configs -= [ "//build/config/compiler:chromium_code" ]
130   configs += [
131     "//build/config/compiler:no_chromium_code",
133     # Must be after no_chromium_code for warning flags to be ordered correctly.
134     ":minizip_warnings",
135   ]
136   public_configs = [ ":zlib_config" ]
139 static_library("zip") {
140   sources = [
141     "google/zip.cc",
142     "google/zip.h",
143     "google/zip_internal.cc",
144     "google/zip_internal.h",
145     "google/zip_reader.cc",
146     "google/zip_reader.h",
147   ]
148   deps = [
149     ":minizip",
150     "//base",
151   ]