OLD | NEW |
(Empty) | |
| 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 (!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 } |
| 26 |
| 27 configs -= [ "//build/config/compiler:chromium_code" ] |
| 28 configs += [ "//build/config/compiler:no_chromium_code" ] |
| 29 } |
| 30 |
| 31 config("zlib_warnings") { |
| 32 if (is_clang && !is_ios && (current_cpu == "x86" || current_cpu == "x64")) { |
| 33 cflags = [ "-Wno-incompatible-pointer-types" ] |
| 34 } |
| 35 } |
| 36 |
| 37 static_library("zlib") { |
| 38 if (!is_win) { |
| 39 # Don't stomp on "libzlib" on other platforms. |
| 40 output_name = "chrome_zlib" |
| 41 } |
| 42 |
| 43 sources = [ |
| 44 "adler32.c", |
| 45 "compress.c", |
| 46 "crc32.c", |
| 47 "crc32.h", |
| 48 "deflate.c", |
| 49 "deflate.h", |
| 50 "gzclose.c", |
| 51 "gzguts.h", |
| 52 "gzlib.c", |
| 53 "gzread.c", |
| 54 "gzwrite.c", |
| 55 "infback.c", |
| 56 "inffast.c", |
| 57 "inffast.h", |
| 58 "inffixed.h", |
| 59 "inflate.c", |
| 60 "inflate.h", |
| 61 "inftrees.c", |
| 62 "inftrees.h", |
| 63 "mozzconf.h", |
| 64 "trees.c", |
| 65 "trees.h", |
| 66 "uncompr.c", |
| 67 "x86.h", |
| 68 "zconf.h", |
| 69 "zlib.h", |
| 70 "zutil.c", |
| 71 "zutil.h", |
| 72 ] |
| 73 |
| 74 if (!is_ios && (current_cpu == "x86" || current_cpu == "x64")) { |
| 75 sources += [ "x86.c" ] |
| 76 } |
| 77 |
| 78 configs -= [ "//build/config/compiler:chromium_code" ] |
| 79 configs += [ |
| 80 "//build/config/compiler:no_chromium_code", |
| 81 |
| 82 # Must be after no_chromium_code for warning flags to be ordered correctly. |
| 83 ":zlib_warnings", |
| 84 ] |
| 85 |
| 86 public_configs = [ ":zlib_config" ] |
| 87 deps = [ |
| 88 ":zlib_x86_simd", |
| 89 ] |
| 90 } |
OLD | NEW |