brettw@chromium.org | 069e2b8 | 2014-04-30 16:47:24 +0000 | [diff] [blame] | 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 | |
robert.bradford | 10dd686 | 2014-11-05 06:59:34 -0800 | [diff] [blame] | 9 | static_library("zlib_x86_simd") { |
dpranke | 4ba7cdd | 2015-02-19 18:55:19 -0800 | [diff] [blame] | 10 | if (!is_ios && (current_cpu == "x86" || current_cpu == "x64")) { |
scottmg | b8135bf | 2014-12-02 23:28:00 -0800 | [diff] [blame] | 11 | sources = [ |
| 12 | "crc_folding.c", |
| 13 | "fill_window_sse.c", |
| 14 | ] |
Nico Weber | 0f60cc5 | 2014-11-18 15:21:17 -0800 | [diff] [blame] | 15 | if (!is_win || is_clang) { |
scottmg | b8135bf | 2014-12-02 23:28:00 -0800 | [diff] [blame] | 16 | cflags = [ |
| 17 | "-msse4.2", |
| 18 | "-mpclmul", |
| 19 | ] |
Nico Weber | 0f60cc5 | 2014-11-18 15:21:17 -0800 | [diff] [blame] | 20 | } |
robert.bradford | 10dd686 | 2014-11-05 06:59:34 -0800 | [diff] [blame] | 21 | } else { |
scottmg | b8135bf | 2014-12-02 23:28:00 -0800 | [diff] [blame] | 22 | sources = [ |
| 23 | "simd_stub.c", |
| 24 | ] |
robert.bradford | 10dd686 | 2014-11-05 06:59:34 -0800 | [diff] [blame] | 25 | } |
dpranke | 7363615 | 2014-11-17 17:54:55 -0800 | [diff] [blame] | 26 | |
| 27 | configs -= [ "//build/config/compiler:chromium_code" ] |
| 28 | configs += [ "//build/config/compiler:no_chromium_code" ] |
robert.bradford | 10dd686 | 2014-11-05 06:59:34 -0800 | [diff] [blame] | 29 | } |
| 30 | |
brettw | 3f3d126 | 2015-09-02 10:57:05 -0700 | [diff] [blame^] | 31 | config("zlib_warnings") { |
| 32 | if (is_clang && !is_ios && |
| 33 | (current_cpu == "x86" || current_cpu == "x64")) { |
| 34 | cflags = [ "-Wno-incompatible-pointer-types" ] |
| 35 | } |
| 36 | } |
| 37 | |
brettw@chromium.org | 069e2b8 | 2014-04-30 16:47:24 +0000 | [diff] [blame] | 38 | static_library("zlib") { |
| 39 | if (!is_win) { |
| 40 | # Don't stomp on "libzlib" on other platforms. |
| 41 | output_name = "chrome_zlib" |
| 42 | } |
| 43 | |
| 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", |
robert.bradford | 10dd686 | 2014-11-05 06:59:34 -0800 | [diff] [blame] | 68 | "x86.h", |
brettw@chromium.org | 069e2b8 | 2014-04-30 16:47:24 +0000 | [diff] [blame] | 69 | "zconf.h", |
| 70 | "zlib.h", |
| 71 | "zutil.c", |
| 72 | "zutil.h", |
| 73 | ] |
| 74 | |
dpranke | 4ba7cdd | 2015-02-19 18:55:19 -0800 | [diff] [blame] | 75 | if (!is_ios && (current_cpu == "x86" || current_cpu == "x64")) { |
robert.bradford | 10dd686 | 2014-11-05 06:59:34 -0800 | [diff] [blame] | 76 | sources += [ "x86.c" ] |
| 77 | } |
| 78 | |
brettw@chromium.org | 069e2b8 | 2014-04-30 16:47:24 +0000 | [diff] [blame] | 79 | configs -= [ "//build/config/compiler:chromium_code" ] |
brettw | 3f3d126 | 2015-09-02 10:57:05 -0700 | [diff] [blame^] | 80 | configs += [ |
| 81 | "//build/config/compiler:no_chromium_code", |
| 82 | |
| 83 | # Must be after no_chromium_code for warning flags to be ordered correctly. |
| 84 | ":zlib_warnings", |
| 85 | ] |
brettw@chromium.org | 069e2b8 | 2014-04-30 16:47:24 +0000 | [diff] [blame] | 86 | |
Brett Wilson | 9bdea3f | 2014-09-23 16:41:46 -0700 | [diff] [blame] | 87 | public_configs = [ ":zlib_config" ] |
scottmg | b8135bf | 2014-12-02 23:28:00 -0800 | [diff] [blame] | 88 | deps = [ |
| 89 | ":zlib_x86_simd", |
| 90 | ] |
brettw@chromium.org | 069e2b8 | 2014-04-30 16:47:24 +0000 | [diff] [blame] | 91 | } |
| 92 | |
brettw | 3f3d126 | 2015-09-02 10:57:05 -0700 | [diff] [blame^] | 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 | } |
| 99 | } |
| 100 | |
brettw@chromium.org | 069e2b8 | 2014-04-30 16:47:24 +0000 | [diff] [blame] | 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 | ] |
| 112 | |
| 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 | } |
| 124 | |
scottmg | b8135bf | 2014-12-02 23:28:00 -0800 | [diff] [blame] | 125 | deps = [ |
| 126 | ":zlib", |
| 127 | ] |
brettw@chromium.org | 069e2b8 | 2014-04-30 16:47:24 +0000 | [diff] [blame] | 128 | |
| 129 | configs -= [ "//build/config/compiler:chromium_code" ] |
brettw | 3f3d126 | 2015-09-02 10:57:05 -0700 | [diff] [blame^] | 130 | configs += [ |
| 131 | "//build/config/compiler:no_chromium_code", |
| 132 | |
| 133 | # Must be after no_chromium_code for warning flags to be ordered correctly. |
| 134 | ":minizip_warnings", |
| 135 | ] |
Brett Wilson | 9bdea3f | 2014-09-23 16:41:46 -0700 | [diff] [blame] | 136 | public_configs = [ ":zlib_config" ] |
brettw@chromium.org | 069e2b8 | 2014-04-30 16:47:24 +0000 | [diff] [blame] | 137 | } |
| 138 | |
jamesr@chromium.org | 8497dcc | 2014-08-13 00:22:04 +0000 | [diff] [blame] | 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 | ] |
brettw@chromium.org | 069e2b8 | 2014-04-30 16:47:24 +0000 | [diff] [blame] | 152 | } |