blob: 6a4c65732cc682ea336a816deff86e56421e8c5c [file] [log] [blame]
mtklein7d10b9f2016-07-27 11:17:18 -07001# 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() {
Mike Kleine459afd2017-03-03 09:21:30 -05007 skia_use_system_libpng = is_official_build
mtklein7d10b9f2016-07-27 11:17:18 -07008}
9
10import("../third_party.gni")
11
Mike Klein10d665d2016-11-01 11:46:10 -040012if (skia_use_system_libpng) {
13 system("libpng") {
14 libs = [ "png" ]
15 }
16} else {
17 third_party("libpng") {
18 public_include_dirs = [ "." ]
mtklein7d10b9f2016-07-27 11:17:18 -070019
Mike Kleind23341b2016-11-07 16:56:53 -050020 defines = []
Mike Klein10d665d2016-11-01 11:46:10 -040021 deps = [
22 "//third_party/zlib",
mtklein7d6fb2c2016-08-25 14:50:44 -070023 ]
Mike Klein10d665d2016-11-01 11:46:10 -040024 sources = [
25 "png.c",
26 "pngerror.c",
27 "pngget.c",
28 "pngmem.c",
29 "pngpread.c",
30 "pngread.c",
31 "pngrio.c",
32 "pngrtran.c",
33 "pngrutil.c",
34 "pngset.c",
35 "pngtrans.c",
36 "pngwio.c",
37 "pngwrite.c",
38 "pngwtran.c",
39 "pngwutil.c",
40 ]
41
42 if (current_cpu == "arm" || current_cpu == "arm64") {
43 sources += [
44 "arm/arm_init.c",
45 "arm/filter_neon_intrinsics.c",
46 ]
47 }
Mike Kleind23341b2016-11-07 16:56:53 -050048
49 if (current_cpu == "x86" || current_cpu == "x64") {
50 defines += [ "PNG_INTEL_SSE" ]
51 sources += [
52 "contrib/intel/filter_sse2_intrinsics.c",
53 "contrib/intel/intel_init.c",
54 ]
55 }
mtklein7d6fb2c2016-08-25 14:50:44 -070056 }
mtklein7d10b9f2016-07-27 11:17:18 -070057}