Teach i18nTemplate.process() to handle <link rel=import> and <template>
[chromium-blink-merge.git] / third_party / zlib / BUILD.gn
bloba1317f222908687b218ae7724bd6a4677669b79e
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   deps = [
106     ":zlib",
107   ]
109   config("minizip_warnings") {
110     if (is_clang) {
111       # zlib uses `if ((a == b))` for some reason.
112       cflags = [ "-Wno-parentheses-equality" ]
113     }
114   }
116   configs -= [ "//build/config/compiler:chromium_code" ]
117   configs += [ "//build/config/compiler:no_chromium_code" ]
118   configs += [ ":minizip_warnings" ]
119   public_configs = [ ":zlib_config" ]
122 static_library("zip") {
123   sources = [
124     "google/zip.cc",
125     "google/zip.h",
126     "google/zip_internal.cc",
127     "google/zip_internal.h",
128     "google/zip_reader.cc",
129     "google/zip_reader.h",
130   ]
131   deps = [
132     ":minizip",
133     "//base",
134   ]