# Copyright (c) 2021 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. if (!is_linux && !is_mingw && !is_mac) { import("//base/update/updater/updater_default_cfg.gni") } import("//build/ohos.gni") SUBSYSTEM_DIR = "//base/update/updater/services/package" config("package_config") { visibility = [ ":*" ] cflags_cc = [ "-std=c++17" ] include_dirs = [ "//base/update/updater/interfaces/kits/include", "//base/update/updater/utils/include", "//base/update/updater/services/include", "//third_party/zlib", "//third_party/openssl/include", "//third_party/lz4/lib", "//base/update/updater/services/include/package", "//base/update/updater/services/include/script", "//base/update/updater/services/include/log", "pkg_algorithm", "pkg_manager", "pkg_package", "pkg_verify", "//third_party/bounds_checking_function/include", ] } ohos_static_library("libupdaterpackage") { sources = [ "$SUBSYSTEM_DIR/pkg_algorithm/pkg_algo_deflate.cpp", "$SUBSYSTEM_DIR/pkg_algorithm/pkg_algo_digest.cpp", "$SUBSYSTEM_DIR/pkg_algorithm/pkg_algo_lz4.cpp", "$SUBSYSTEM_DIR/pkg_algorithm/pkg_algo_sign.cpp", "$SUBSYSTEM_DIR/pkg_algorithm/pkg_algorithm.cpp", "$SUBSYSTEM_DIR/pkg_manager/pkg_managerImpl.cpp", "$SUBSYSTEM_DIR/pkg_manager/pkg_stream.cpp", "$SUBSYSTEM_DIR/pkg_manager/pkg_utils.cpp", "$SUBSYSTEM_DIR/pkg_package/packages_info.cpp", "$SUBSYSTEM_DIR/pkg_package/pkg_gzipfile.cpp", "$SUBSYSTEM_DIR/pkg_package/pkg_lz4file.cpp", "$SUBSYSTEM_DIR/pkg_package/pkg_pkgfile.cpp", "$SUBSYSTEM_DIR/pkg_package/pkg_upgradefile.cpp", "$SUBSYSTEM_DIR/pkg_package/pkg_zipfile.cpp", "$SUBSYSTEM_DIR/pkg_verify/cert_verify.cpp", "$SUBSYSTEM_DIR/pkg_verify/openssl_util.cpp", "$SUBSYSTEM_DIR/pkg_verify/pkcs7_signed_data.cpp", "$SUBSYSTEM_DIR/pkg_verify/pkg_verify_util.cpp", "$SUBSYSTEM_DIR/pkg_verify/zip_pkg_parse.cpp", ] deps = [ "//base/update/updater/services/log:libupdaterlog", "//third_party/bounds_checking_function:libsec_static", "//third_party/openssl:libcrypto_static", ] configs = [ ":package_config" ] if (is_mingw) { libs = [ "setupapi", "psapi", "user32", "advapi32", "iphlpapi", "userenv", "ws2_32", ] ldflags = [ "-Wl,--whole-archive", "-lpthread", "-Wl,--no-whole-archive", ] } }