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