aboutsummaryrefslogtreecommitdiffhomepage
path: root/third_party/libpng
diff options
context:
space:
mode:
authorGravatar Mike Klein <mtklein@chromium.org>2016-11-01 11:46:10 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-11-01 16:17:38 +0000
commit10d665d000cfdce693b7ca088fb2c61ed54bcdfb (patch)
treef8f6776f60c5636881bb52daeaf3b2b095ffd38f /third_party/libpng
parent5e25717ab6313b011ec54eac0109c414aa8ffc17 (diff)
Allow most third_party targets to use system libraries if asked.
This extends the pattern in freetype2 to expat, icu, libjpeg-turbo, libpng, libwebp, and zlib, and gives all these an arg to control which to use. Homebrew doesn't have dng_sdk, piex, or sftnly, or I'd have done the same for them too. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4260 DOCS_PREVIEW= https://skia.org/?cl=4260 Change-Id: I82e780502bf2217336e791787f172a6fc8f55460 Reviewed-on: https://skia-review.googlesource.com/4260 Commit-Queue: Mike Klein <mtklein@chromium.org> Reviewed-by: Hal Canary <halcanary@google.com>
Diffstat (limited to 'third_party/libpng')
-rw-r--r--third_party/libpng/BUILD.gn61
1 files changed, 34 insertions, 27 deletions
diff --git a/third_party/libpng/BUILD.gn b/third_party/libpng/BUILD.gn
index 5cd865529e..2e3c01c399 100644
--- a/third_party/libpng/BUILD.gn
+++ b/third_party/libpng/BUILD.gn
@@ -4,38 +4,45 @@
# found in the LICENSE file.
declare_args() {
+ skia_use_system_libpng = false
}
import("../third_party.gni")
-third_party("libpng") {
- public_include_dirs = [ "." ]
-
- 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 (skia_use_system_libpng) {
+ system("libpng") {
+ libs = [ "png" ]
+ }
+} else {
+ third_party("libpng") {
+ public_include_dirs = [ "." ]
- if (current_cpu == "arm" || current_cpu == "arm64") {
- sources += [
- "arm/arm_init.c",
- "arm/filter_neon_intrinsics.c",
+ 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",
+ ]
+ }
}
}