aboutsummaryrefslogtreecommitdiffhomepage
path: root/third_party/libpng/BUILD.gn
blob: 3e97f5569a681c080d8ad94771f21f332b2fc5cd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# Copyright 2016 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

declare_args() {
  skia_use_system_libpng = false
}

import("../third_party.gni")

if (skia_use_system_libpng) {
  system("libpng") {
    libs = [ "png" ]
  }
} else {
  third_party("libpng") {
    public_include_dirs = [ "." ]

    defines = []
    deps = [
      "//third_party/zlib",
    ]
    sources = [
      "png.c",
      "pngerror.c",
      "pngget.c",
      "pngmem.c",
      "pngpread.c",
      "pngread.c",
      "pngrio.c",
      "pngrtran.c",
      "pngrutil.c",
      "pngset.c",
      "pngtrans.c",
      "pngwio.c",
      "pngwrite.c",
      "pngwtran.c",
      "pngwutil.c",
    ]

    if (current_cpu == "arm" || current_cpu == "arm64") {
      sources += [
        "arm/arm_init.c",
        "arm/filter_neon_intrinsics.c",
      ]
    }

    if (current_cpu == "x86" || current_cpu == "x64") {
      defines += [ "PNG_INTEL_SSE" ]
      sources += [
        "contrib/intel/filter_sse2_intrinsics.c",
        "contrib/intel/intel_init.c",
      ]
    }
  }
}