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    "-fstack-protector-strong",
31    "-D_FORTIFY_SOURCE=2",
32    "-Os",
33  ]
34
35  cflags_cc = [
36    "-fvisibility-inlines-hidden",
37    "-Os",
38  ]
39}
40
41ohos_shared_library("appdomainverify_napi") {
42  branch_protector_ret = "pac_ret"
43  sources = [
44    "src/api_event_reporter.cpp",
45    "src/app_domain_verify_manager_napi.cpp",
46    "src/config_parser.cpp",
47    "src/native_module.cpp",
48  ]
49  public_configs = [ ":app_domain_verify_mgr_napi_config" ]
50  deps = [
51    "${app_domain_verify_client_path}:app_domain_verify_mgr_client",
52    "${app_domain_verify_common_path}:app_domain_verify_common",
53  ]
54  external_deps = [
55    "ability_base:want",
56    "bundle_framework:appexecfwk_base",
57    "c_utils:utils",
58    "hiappevent:hiappevent_innerapi",
59    "hilog:libhilog",
60    "ipc:ipc_core",
61    "napi:ace_napi",
62    "safwk:system_ability_fwk",
63    "samgr:samgr_proxy",
64  ]
65  defines = []
66  if (build_variant == "user") {
67    defines += [ "IS_RELEASE_VERSION" ]
68  }
69
70  relative_install_dir = "module/bundle"
71  subsystem_name = "bundlemanager"
72  part_name = "app_domain_verify"
73}
74