diff --git a/BUILD.gn b/BUILD.gn index 7232eadc560ba123c4264de2fd16aae7c5ae36ba..4c54087e5a9073d9838b2951a329012ff430be78 100755 --- a/BUILD.gn +++ b/BUILD.gn @@ -1,5 +1,6 @@ # Copyright (c) 2023 Huawei Device Co., Ltd. All rights reserved. +import("//build/config/config.gni") import("//build/ohos.gni") import("//build/ohos/ndk/ndk.gni") @@ -90,6 +91,14 @@ ohos_shared_library("shared_libz") { configs = [ ":zlib_config" ] public_configs = [ ":zlib_public_config" ] + if (current_os == "ios") { + ldflags = [ + "-Wl", + "-install_name", + "@rpath/libshared_libz.framework/libshared_libz", + ] + } + install_images = [ "system", "updater", @@ -102,6 +111,14 @@ ohos_shared_library("shared_libz") { subsystem_name = "thirdparty" } +if (current_os == "ios") { + ohos_combine_darwin_framework("libshared_libz") { + deps = [ ":shared_libz" ] + subsystem_name = "thirdparty" + part_name = "zlib" + } +} + ohos_ndk_headers("zlib_header") { sources = [ "./zconf.h",