# Copyright (c) 2024 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. import("//base/startup/appspawn/appspawn.gni") import("//build/ohos.gni") if (!defined(ohos_lite)) { ohos_executable("hnp") { include_dirs = [ "base", "installer/include", ] sources = [ "${appspawn_path}/service/hnp/base/hnp_file.c", "${appspawn_path}/service/hnp/base/hnp_json.c", "${appspawn_path}/service/hnp/base/hnp_log.c", "${appspawn_path}/service/hnp/base/hnp_sal.c", "${appspawn_path}/service/hnp/base/hnp_zip.c", "${appspawn_path}/service/hnp/hnp_main.c", "${appspawn_path}/service/hnp/installer/src/hnp_installer.c", ] configs = [] cflags = [] external_deps = [ "bounds_checking_function:libsec_shared", "cJSON:cjson", "code_signature:libcode_sign_utils", "hilog:libhilog", "selinux_adapter:librestorecon", "zlib:shared_libz", ] defines = [] if (defined(global_parts_info) && defined(global_parts_info.security_code_signature)) { defines += [ "CODE_SIGNATURE_ENABLE" ] } install_enable = true subsystem_name = "${subsystem_name}" part_name = "${part_name}" } ohos_executable("hnpcli") { include_dirs = [ "pack/include", "base", ] sources = [ "${appspawn_path}/service/hnp/base/hnp_file.c", "${appspawn_path}/service/hnp/base/hnp_json.c", "${appspawn_path}/service/hnp/base/hnp_log.c", "${appspawn_path}/service/hnp/base/hnp_zip.c", "${appspawn_path}/service/hnp/hnpcli_main.c", "${appspawn_path}/service/hnp/pack/src/hnp_pack.c", ] configs = [] cflags = [] defines = [ "HNP_CLI" ] external_deps = [ "bounds_checking_function:libsec_static", "cJSON:cjson_static", "zlib:libz", ] install_enable = true subsystem_name = "${subsystem_name}" part_name = "${part_name}" } } group("hnpcli_host_toolchain") { deps = [ ":hnpcli($host_toolchain)" ] }