• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2016 Google Inc.
2#
3# Use of this source code is governed by a BSD-style license that can be
4# found in the LICENSE file.
5
6declare_args() {
7  skia_use_system_zlib = is_official_build
8}
9
10import("../third_party.gni")
11
12if (skia_use_system_zlib) {
13  system("zlib") {
14    libs = [ "z" ]
15  }
16} else {
17  third_party("zlib") {
18    public_include_dirs = [ "../externals/zlib" ]
19
20    deps = [
21      ":zlib_x86",
22    ]
23    sources = [
24      "../externals/zlib/adler32.c",
25      "../externals/zlib/compress.c",
26      "../externals/zlib/crc32.c",
27      "../externals/zlib/deflate.c",
28      "../externals/zlib/gzclose.c",
29      "../externals/zlib/gzlib.c",
30      "../externals/zlib/gzread.c",
31      "../externals/zlib/gzwrite.c",
32      "../externals/zlib/infback.c",
33      "../externals/zlib/inffast.c",
34      "../externals/zlib/inflate.c",
35      "../externals/zlib/inftrees.c",
36      "../externals/zlib/trees.c",
37      "../externals/zlib/uncompr.c",
38      "../externals/zlib/zutil.c",
39    ]
40  }
41}
42
43third_party("zlib_x86") {
44  public_include_dirs = []
45  if (target_cpu == "x86" || target_cpu == "x64") {
46    sources = [
47      "../externals/zlib/crc_folding.c",
48      "../externals/zlib/fill_window_sse.c",
49      "../externals/zlib/x86.c",
50    ]
51    if (!is_win || is_clang) {
52      cflags_c = [
53        "-msse4.2",
54        "-mpclmul",
55      ]
56    }
57  } else {
58    sources = [
59      "../externals/zlib/simd_stub.c",
60    ]
61  }
62}
63