mirror of
https://github.com/openharmony/third_party_libpng.git
synced 2026-07-01 09:25:04 -04:00
86e77a81f4
libpng hisi侧依赖,添加visibility控制 Signed-off-by: zfshank <479390563@qq.com>
168 lines
4.8 KiB
Plaintext
Executable File
168 lines
4.8 KiB
Plaintext
Executable File
# Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved.
|
|
|
|
import("//build/ohos.gni")
|
|
|
|
action("libpng_action") {
|
|
script = "//third_party/libpng/install.py"
|
|
outputs = [
|
|
"${target_gen_dir}/libpng-1.6.44/png.c",
|
|
"${target_gen_dir}/libpng-1.6.44/pngerror.c",
|
|
"${target_gen_dir}/libpng-1.6.44/pngget.c",
|
|
"${target_gen_dir}/libpng-1.6.44/pngmem.c",
|
|
"${target_gen_dir}/libpng-1.6.44/pngpread.c",
|
|
"${target_gen_dir}/libpng-1.6.44/pngread.c",
|
|
"${target_gen_dir}/libpng-1.6.44/pngrio.c",
|
|
"${target_gen_dir}/libpng-1.6.44/pngrtran.c",
|
|
"${target_gen_dir}/libpng-1.6.44/pngrutil.c",
|
|
"${target_gen_dir}/libpng-1.6.44/pngset.c",
|
|
"${target_gen_dir}/libpng-1.6.44/pngtrans.c",
|
|
"${target_gen_dir}/libpng-1.6.44/pngwio.c",
|
|
"${target_gen_dir}/libpng-1.6.44/pngwrite.c",
|
|
"${target_gen_dir}/libpng-1.6.44/pngwtran.c",
|
|
"${target_gen_dir}/libpng-1.6.44/pngwutil.c",
|
|
"${target_gen_dir}/libpng-1.6.44/arm/arm_init.c",
|
|
"${target_gen_dir}/libpng-1.6.44/arm/filter_neon_intrinsics.c",
|
|
"${target_gen_dir}/libpng-1.6.44/arm/palette_neon_intrinsics.c",
|
|
]
|
|
|
|
inputs = [ "//third_party/libpng/libpng-1.6.44.tar.gz" ]
|
|
|
|
inputs += [
|
|
"backport-libpng-1.6.37-enable-valid.patch",
|
|
"CVE-2018-14048.patch",
|
|
"CVE-2019-6129.patch",
|
|
"huawei_libpng_CMakeList.patch",
|
|
"libpng-fix-arm-neon.patch",
|
|
"libpng-multilib.patch",
|
|
"libpng_optimize.patch",
|
|
]
|
|
|
|
libpng_path = rebase_path("${target_gen_dir}", root_build_dir)
|
|
libpng_source_path = rebase_path("//third_party/libpng", root_build_dir)
|
|
args = [
|
|
"--gen-dir",
|
|
"$libpng_path",
|
|
"--source-dir",
|
|
"$libpng_source_path",
|
|
]
|
|
}
|
|
|
|
if (defined(ohos_lite)) {
|
|
import("//build/lite/config/component/lite_component.gni")
|
|
|
|
config("libpng_config") {
|
|
include_dirs = [ "${target_gen_dir}/libpng-1.6.44/" ]
|
|
}
|
|
|
|
libpng_source = get_target_outputs(":libpng_action")
|
|
|
|
lite_library("libpng") {
|
|
if (ohos_kernel_type == "liteos_m") {
|
|
target_type = "static_library"
|
|
deps = [ "//build/lite/config/component/zlib:zlib_static" ]
|
|
} else {
|
|
target_type = "shared_library"
|
|
deps = [ "//build/lite/config/component/zlib:zlib_shared" ]
|
|
}
|
|
deps += [ ":libpng_action" ]
|
|
if (defined(board_toolchain_type) && board_toolchain_type == "iccarm") {
|
|
cflags = [
|
|
"--diag_suppress",
|
|
"Pa082,Pa084",
|
|
]
|
|
cflags_cc = cflags
|
|
}
|
|
sources = libpng_source
|
|
public_configs = [ ":libpng_config" ]
|
|
}
|
|
} else {
|
|
import("//build/ohos.gni")
|
|
|
|
config("libpng_config") {
|
|
include_dirs = [ "${target_gen_dir}/libpng-1.6.44/" ]
|
|
}
|
|
|
|
config("libpng_wno_config") {
|
|
cflags = [ "-Wno-implicit-fallthrough" ]
|
|
if (target_platform == "pc") {
|
|
if (is_ohos && is_clang &&
|
|
(target_cpu == "arm" || target_cpu == "arm64")) {
|
|
ldflags = [ "-Wl,-Bsymbolic" ]
|
|
defines = [ "PNG_ARM_NEON" ]
|
|
}
|
|
}
|
|
}
|
|
|
|
config("libpng_wno_config_static") {
|
|
if (target_platform == "pc") {
|
|
if (is_ohos && is_clang &&
|
|
(target_cpu == "arm" || target_cpu == "arm64")) {
|
|
cflags = [ "-fvisibility=hidden" ]
|
|
}
|
|
}
|
|
}
|
|
|
|
ohos_source_set("png_static") {
|
|
sources = get_target_outputs(":libpng_action")
|
|
include_dirs = [ "${target_gen_dir}/libpng-1.6.44/" ]
|
|
external_deps = [ "zlib:libz" ]
|
|
deps = [ ":libpng_action" ]
|
|
public_configs = [ ":libpng_config" ]
|
|
part_name = "libpng"
|
|
subsystem_name = "thirdparty"
|
|
}
|
|
|
|
ohos_shared_library("libpng") {
|
|
sources = get_target_outputs(":libpng_action")
|
|
include_dirs = [ "${target_gen_dir}/libpng-1.6.44/" ]
|
|
deps = [ ":libpng_action" ]
|
|
if (is_arkui_x) {
|
|
deps += [ "//third_party/zlib:libz" ]
|
|
} else {
|
|
external_deps = [ "zlib:libz" ]
|
|
}
|
|
|
|
public_configs = [ ":libpng_config" ]
|
|
configs = [ ":libpng_wno_config" ]
|
|
innerapi_tags = [
|
|
"platformsdk",
|
|
"chipsetsdk",
|
|
]
|
|
subsystem_name = "thirdparty"
|
|
install_images = [
|
|
"system",
|
|
"updater",
|
|
]
|
|
part_name = "libpng"
|
|
output_name = "libpng"
|
|
install_enable = true
|
|
}
|
|
|
|
ohos_static_library("libpng_static") {
|
|
visibility = [
|
|
":*",
|
|
"//foundation/arkui/ui_ext_lite/tools/ide/*",
|
|
"//foundation/arkui/ui_lite/ext/ide/*",
|
|
"//developtools/global_resource_tool/*",
|
|
"//third_party/freetype/*",
|
|
"//third_party/skia/m133/*",
|
|
"//out/*",
|
|
"//vendor/hisi/confidential/contexthub/src/framework/hisi/ui/third_party/*",
|
|
]
|
|
sources = get_target_outputs(":libpng_action")
|
|
|
|
include_dirs = [ "${target_gen_dir}/libpng-1.6.44/" ]
|
|
deps = [ ":libpng_action" ]
|
|
if (is_arkui_x) {
|
|
deps += [ "//third_party/zlib:libz" ]
|
|
} else {
|
|
external_deps = [ "zlib:libz" ]
|
|
}
|
|
public_configs = [ ":libpng_config" ]
|
|
configs = [ ":libpng_wno_config" ]
|
|
configs += [ ":libpng_wno_config_static" ]
|
|
part_name = "libpng"
|
|
subsystem_name = "thirdparty"
|
|
}
|
|
}
|