2016-07-27 18:17:18 +00:00
|
|
|
# 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() {
|
2017-03-03 14:21:30 +00:00
|
|
|
skia_use_system_libpng = is_official_build
|
2016-07-27 18:17:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
import("../third_party.gni")
|
|
|
|
|
2016-11-01 15:46:10 +00:00
|
|
|
if (skia_use_system_libpng) {
|
|
|
|
system("libpng") {
|
|
|
|
libs = [ "png" ]
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
third_party("libpng") {
|
2017-09-19 17:30:58 +00:00
|
|
|
public_include_dirs = [
|
|
|
|
".",
|
|
|
|
"../externals/libpng",
|
|
|
|
]
|
2016-08-25 21:50:44 +00:00
|
|
|
|
2016-11-07 21:56:53 +00:00
|
|
|
defines = []
|
2016-11-01 15:46:10 +00:00
|
|
|
deps = [
|
|
|
|
"//third_party/zlib",
|
2016-08-25 21:50:44 +00:00
|
|
|
]
|
2016-11-01 15:46:10 +00:00
|
|
|
sources = [
|
2017-09-19 17:30:58 +00:00
|
|
|
"../externals/libpng/png.c",
|
|
|
|
"../externals/libpng/pngerror.c",
|
|
|
|
"../externals/libpng/pngget.c",
|
|
|
|
"../externals/libpng/pngmem.c",
|
|
|
|
"../externals/libpng/pngpread.c",
|
|
|
|
"../externals/libpng/pngread.c",
|
|
|
|
"../externals/libpng/pngrio.c",
|
|
|
|
"../externals/libpng/pngrtran.c",
|
|
|
|
"../externals/libpng/pngrutil.c",
|
|
|
|
"../externals/libpng/pngset.c",
|
|
|
|
"../externals/libpng/pngtrans.c",
|
|
|
|
"../externals/libpng/pngwio.c",
|
|
|
|
"../externals/libpng/pngwrite.c",
|
|
|
|
"../externals/libpng/pngwtran.c",
|
|
|
|
"../externals/libpng/pngwutil.c",
|
2016-11-01 15:46:10 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
if (current_cpu == "arm" || current_cpu == "arm64") {
|
|
|
|
sources += [
|
2017-09-19 17:30:58 +00:00
|
|
|
"../externals/libpng/arm/arm_init.c",
|
|
|
|
"../externals/libpng/arm/filter_neon_intrinsics.c",
|
2016-11-01 15:46:10 +00:00
|
|
|
]
|
|
|
|
}
|
2016-11-07 21:56:53 +00:00
|
|
|
|
|
|
|
if (current_cpu == "x86" || current_cpu == "x64") {
|
|
|
|
defines += [ "PNG_INTEL_SSE" ]
|
|
|
|
sources += [
|
2017-09-19 17:30:58 +00:00
|
|
|
"../externals/libpng/intel/filter_sse2_intrinsics.c",
|
|
|
|
"../externals/libpng/intel/intel_init.c",
|
2016-11-07 21:56:53 +00:00
|
|
|
]
|
|
|
|
}
|
2016-08-25 21:50:44 +00:00
|
|
|
}
|
2016-07-27 18:17:18 +00:00
|
|
|
}
|