mtklein | 7d10b9f | 2016-07-27 11:17:18 -0700 | [diff] [blame] | 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 | |
| 6 | declare_args() { |
Mike Klein | e459afd | 2017-03-03 09:21:30 -0500 | [diff] [blame] | 7 | skia_use_system_libpng = is_official_build |
mtklein | 7d10b9f | 2016-07-27 11:17:18 -0700 | [diff] [blame] | 8 | } |
| 9 | |
| 10 | import("../third_party.gni") |
| 11 | |
Mike Klein | 10d665d | 2016-11-01 11:46:10 -0400 | [diff] [blame] | 12 | if (skia_use_system_libpng) { |
| 13 | system("libpng") { |
| 14 | libs = [ "png" ] |
| 15 | } |
| 16 | } else { |
| 17 | third_party("libpng") { |
| 18 | public_include_dirs = [ "." ] |
mtklein | 7d10b9f | 2016-07-27 11:17:18 -0700 | [diff] [blame] | 19 | |
Mike Klein | d23341b | 2016-11-07 16:56:53 -0500 | [diff] [blame] | 20 | defines = [] |
Mike Klein | 10d665d | 2016-11-01 11:46:10 -0400 | [diff] [blame] | 21 | deps = [ |
| 22 | "//third_party/zlib", |
mtklein | 7d6fb2c | 2016-08-25 14:50:44 -0700 | [diff] [blame] | 23 | ] |
Mike Klein | 10d665d | 2016-11-01 11:46:10 -0400 | [diff] [blame] | 24 | 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 Klein | d23341b | 2016-11-07 16:56:53 -0500 | [diff] [blame] | 48 | |
| 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 | } |
mtklein | 7d6fb2c | 2016-08-25 14:50:44 -0700 | [diff] [blame] | 56 | } |
mtklein | 7d10b9f | 2016-07-27 11:17:18 -0700 | [diff] [blame] | 57 | } |