• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2024 Huawei Device Co., Ltd.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6#     http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13import("//base/startup/appspawn/appspawn.gni")
14import("//build/ohos.gni")
15
16if (!defined(ohos_lite)) {
17  ohos_executable("hnp") {
18    include_dirs = [
19      "base",
20      "installer/include",
21    ]
22    sources = [
23      "${appspawn_path}/service/hnp/base/hnp_file.c",
24      "${appspawn_path}/service/hnp/base/hnp_json.c",
25      "${appspawn_path}/service/hnp/base/hnp_log.c",
26      "${appspawn_path}/service/hnp/base/hnp_sal.c",
27      "${appspawn_path}/service/hnp/base/hnp_zip.c",
28      "${appspawn_path}/service/hnp/hnp_main.c",
29      "${appspawn_path}/service/hnp/installer/src/hnp_installer.c",
30    ]
31    configs = []
32    cflags = []
33    external_deps = [
34      "bounds_checking_function:libsec_shared",
35      "cJSON:cjson",
36      "hilog:libhilog",
37      "selinux_adapter:librestorecon",
38      "zlib:shared_libz",
39    ]
40
41    if (appspawn_support_code_signature) {
42      external_deps += [ "code_signature:libcode_sign_utils" ]
43    }
44
45    defines = []
46    if (defined(global_parts_info) &&
47        defined(global_parts_info.security_code_signature) &&
48        appspawn_support_code_signature) {
49      defines += [ "CODE_SIGNATURE_ENABLE" ]
50    }
51    install_enable = true
52    subsystem_name = "${subsystem_name}"
53    part_name = "${part_name}"
54  }
55
56  ohos_executable("hnpcli") {
57    include_dirs = [
58      "pack/include",
59      "base",
60    ]
61    sources = [
62      "${appspawn_path}/service/hnp/base/hnp_file.c",
63      "${appspawn_path}/service/hnp/base/hnp_json.c",
64      "${appspawn_path}/service/hnp/base/hnp_log.c",
65      "${appspawn_path}/service/hnp/base/hnp_zip.c",
66      "${appspawn_path}/service/hnp/hnpcli_main.c",
67      "${appspawn_path}/service/hnp/pack/src/hnp_pack.c",
68    ]
69    configs = []
70    cflags = []
71    defines = [ "HNP_CLI" ]
72
73    external_deps = [
74      "bounds_checking_function:libsec_static",
75      "cJSON:cjson_static",
76      "zlib:libz",
77    ]
78    install_enable = true
79    subsystem_name = "${subsystem_name}"
80    part_name = "${part_name}"
81  }
82}
83