Finish refactoring of DomCodeToUsLayoutKeyboardCode().
[chromium-blink-merge.git] / third_party / zlib / BUILD.gn
blob0d592189c8b1811dd565f946fb1901ac6dbe548b
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" ]
71     config("zlib_warnings") {
72       if (is_clang) {
73         cflags = [ "-Wno-incompatible-pointer-types" ]
74       }
75     }
76     configs += [ ":zlib_warnings" ]
77   }
79   configs -= [ "//build/config/compiler:chromium_code" ]
80   configs += [ "//build/config/compiler:no_chromium_code" ]
82   public_configs = [ ":zlib_config" ]
83   deps = [
84     ":zlib_x86_simd",
85   ]
88 static_library("minizip") {
89   sources = [
90     "contrib/minizip/ioapi.c",
91     "contrib/minizip/ioapi.h",
92     "contrib/minizip/iowin32.c",
93     "contrib/minizip/iowin32.h",
94     "contrib/minizip/unzip.c",
95     "contrib/minizip/unzip.h",
96     "contrib/minizip/zip.c",
97     "contrib/minizip/zip.h",
98   ]
100   if (!is_win) {
101     sources -= [
102       "contrib/minizip/iowin32.c",
103       "contrib/minizip/iowin32.h",
104     ]
105   }
106   if (is_mac || is_ios || is_android) {
107     # Mac, Android and the BSDs don't have fopen64, ftello64, or fseeko64. We
108     # use fopen, ftell, and fseek instead on these systems.
109     defines = [ "USE_FILE32API" ]
110   }
112   deps = [
113     ":zlib",
114   ]
116   config("minizip_warnings") {
117     if (is_clang) {
118       # zlib uses `if ((a == b))` for some reason.
119       cflags = [ "-Wno-parentheses-equality" ]
120     }
121   }
123   configs -= [ "//build/config/compiler:chromium_code" ]
124   configs += [ "//build/config/compiler:no_chromium_code" ]
125   configs += [ ":minizip_warnings" ]
126   public_configs = [ ":zlib_config" ]
129 static_library("zip") {
130   sources = [
131     "google/zip.cc",
132     "google/zip.h",
133     "google/zip_internal.cc",
134     "google/zip_internal.h",
135     "google/zip_reader.cc",
136     "google/zip_reader.h",
137   ]
138   deps = [
139     ":minizip",
140     "//base",
141   ]