skia2/third_party/libpng/BUILD.gn

61 lines
1.5 KiB
Plaintext
Raw Normal View History

# 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() {
Strengthen is_official_build, update docs. This makes is_official_build turn off all development targets and features in Skia, including building third-party dependencies from source. This will intentionally break some external users, who will find themselves no longer able to find third-party headers or link against third-party libraries. These users have been building with our testing third-party dependencies unknowingly. They'll need to either explicitly turn back on building each dependency from source (skia_use_system_foo=false) or disable that dependency entirely (skia_use_foo=false). is_skia_standalone is now basically !is_official_build, so I've propagated that through, removing is_skia_standalone. In a few places we were using it as a stand-in for defined(ndk), so I've just written defined(ndk) there. Duh. gn_to_bp: is_offical_build's new strength also makes gn_to_bp.py simpler to write. In spirit, Android builds are official Skia builds that also build DM and nanobench. It seems that SkJumper (src/jumper/*) is (unintentionally) enabled on Android. Switching to an is_official_build would have disabled that. But as that accidental launch seems to have gone fine, I've kept it explicitly enabled. In the end, no changes to Android.bp or its SkUserConfig.h. The -Mini builder no longer needs to explicitly disable tools. CQ_INCLUDE_TRYBOTS=skia.primary:Build-Ubuntu-Clang-x86_64-Release-Mini Change-Id: Id06e53268a5caf55c6046ada354a0863c3031c73 Reviewed-on: https://skia-review.googlesource.com/9190 Reviewed-by: Leon Scroggins <scroggo@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-03-03 14:21:30 +00:00
skia_use_system_libpng = is_official_build
}
import("../third_party.gni")
if (skia_use_system_libpng) {
system("libpng") {
libs = [ "png" ]
}
} else {
third_party("libpng") {
public_include_dirs = [
".",
"../externals/libpng",
]
defines = [ "PNG_SET_OPTION_SUPPORTED" ]
deps = [
"//third_party/zlib",
]
sources = [
"../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",
]
if (current_cpu == "arm" || current_cpu == "arm64") {
sources += [
"../externals/libpng/arm/arm_init.c",
"../externals/libpng/arm/filter_neon_intrinsics.c",
]
}
if (current_cpu == "x86" || current_cpu == "x64") {
defines += [ "PNG_INTEL_SSE" ]
sources += [
"../externals/libpng/intel/filter_sse2_intrinsics.c",
"../externals/libpng/intel/intel_init.c",
]
}
}
}