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") { |
Mike Klein | 6b6674d | 2017-09-19 13:30:58 -0400 | [diff] [blame] | 18 | public_include_dirs = [ |
| 19 | ".", |
| 20 | "../externals/libpng", |
| 21 | ] |
mtklein | 7d10b9f | 2016-07-27 11:17:18 -0700 | [diff] [blame] | 22 | |
Mike Klein | d23341b | 2016-11-07 16:56:53 -0500 | [diff] [blame] | 23 | defines = [] |
Mike Klein | 10d665d | 2016-11-01 11:46:10 -0400 | [diff] [blame] | 24 | deps = [ |
| 25 | "//third_party/zlib", |
mtklein | 7d6fb2c | 2016-08-25 14:50:44 -0700 | [diff] [blame] | 26 | ] |
Mike Klein | 10d665d | 2016-11-01 11:46:10 -0400 | [diff] [blame] | 27 | sources = [ |
Mike Klein | 6b6674d | 2017-09-19 13:30:58 -0400 | [diff] [blame] | 28 | "../externals/libpng/png.c", |
| 29 | "../externals/libpng/pngerror.c", |
| 30 | "../externals/libpng/pngget.c", |
| 31 | "../externals/libpng/pngmem.c", |
| 32 | "../externals/libpng/pngpread.c", |
| 33 | "../externals/libpng/pngread.c", |
| 34 | "../externals/libpng/pngrio.c", |
| 35 | "../externals/libpng/pngrtran.c", |
| 36 | "../externals/libpng/pngrutil.c", |
| 37 | "../externals/libpng/pngset.c", |
| 38 | "../externals/libpng/pngtrans.c", |
| 39 | "../externals/libpng/pngwio.c", |
| 40 | "../externals/libpng/pngwrite.c", |
| 41 | "../externals/libpng/pngwtran.c", |
| 42 | "../externals/libpng/pngwutil.c", |
Mike Klein | 10d665d | 2016-11-01 11:46:10 -0400 | [diff] [blame] | 43 | ] |
| 44 | |
| 45 | if (current_cpu == "arm" || current_cpu == "arm64") { |
| 46 | sources += [ |
Mike Klein | 6b6674d | 2017-09-19 13:30:58 -0400 | [diff] [blame] | 47 | "../externals/libpng/arm/arm_init.c", |
| 48 | "../externals/libpng/arm/filter_neon_intrinsics.c", |
Mike Klein | 10d665d | 2016-11-01 11:46:10 -0400 | [diff] [blame] | 49 | ] |
| 50 | } |
Mike Klein | d23341b | 2016-11-07 16:56:53 -0500 | [diff] [blame] | 51 | |
| 52 | if (current_cpu == "x86" || current_cpu == "x64") { |
| 53 | defines += [ "PNG_INTEL_SSE" ] |
| 54 | sources += [ |
Mike Klein | 6b6674d | 2017-09-19 13:30:58 -0400 | [diff] [blame] | 55 | "../externals/libpng/intel/filter_sse2_intrinsics.c", |
| 56 | "../externals/libpng/intel/intel_init.c", |
Mike Klein | d23341b | 2016-11-07 16:56:53 -0500 | [diff] [blame] | 57 | ] |
| 58 | } |
mtklein | 7d6fb2c | 2016-08-25 14:50:44 -0700 | [diff] [blame] | 59 | } |
mtklein | 7d10b9f | 2016-07-27 11:17:18 -0700 | [diff] [blame] | 60 | } |