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.
13
14import("//build/ohos.gni")
15import("//foundation/bundlemanager/app_domain_verify/app_domain_verify.gni")
16config("app_domain_verify_mgr_napi_config") {
17  visibility = [ ":*" ]
18  include_dirs = [
19    "include",
20    "${app_domain_verify_client_path}/include",
21    "${app_domain_verify_common_path}/include",
22    "${app_domain_verify_common_path}/include/zidl",
23  ]
24  configs = [ "//build/config/compiler:exceptions" ]
25  ldflags = [ "-Wl,--exclude-libs=ALL" ]
26  cflags = [
27    "-fvisibility=hidden",
28    "-fdata-sections",
29    "-ffunction-sections",
30    "-Os",
31  ]
32
33  cflags_cc = [
34    "-fvisibility-inlines-hidden",
35    "-Os",
36  ]
37}
38
39ohos_shared_library("appdomainverify_napi") {
40  branch_protector_ret = "pac_ret"
41  sources = [
42    "src/api_event_reporter.cpp",
43    "src/app_domain_verify_manager_napi.cpp",
44    "src/config_parser.cpp",
45    "src/native_module.cpp",
46  ]
47  public_configs = [ ":app_domain_verify_mgr_napi_config" ]
48  deps = [
49    "${app_domain_verify_client_path}:app_domain_verify_mgr_client",
50    "${app_domain_verify_common_path}:app_domain_verify_common",
51  ]
52  external_deps = [
53    "ability_base:want",
54    "bundle_framework:appexecfwk_base",
55    "c_utils:utils",
56    "hiappevent:hiappevent_innerapi",
57    "hilog:libhilog",
58    "ipc:ipc_core",
59    "napi:ace_napi",
60    "safwk:system_ability_fwk",
61    "samgr:samgr_proxy",
62  ]
63  defines = []
64  if (build_variant == "user") {
65    defines += [ "IS_RELEASE_VERSION" ]
66  }
67
68  relative_install_dir = "module/bundle"
69  subsystem_name = "bundlemanager"
70  part_name = "app_domain_verify"
71}
72