1# Copyright (c) 2023 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")
16
17config("app_domain_verify_mgr_client_config") {
18  visibility = [ ":*" ]
19  include_dirs = [
20    "include",
21    "${app_domain_verify_service_path}/include/manager/core",
22    "${app_domain_verify_service_path}/include/manager/zidl",
23    "${app_domain_verify_common_path}/include",
24    "${app_domain_verify_common_path}/include/zidl",
25    "${app_domain_verify_frameworks_common_path}/include",
26    "${app_domain_verify_frameworks_common_path}/include/dfx",
27  ]
28  cflags = [
29    "-fdata-sections",
30    "-ffunction-sections",
31    "-fstack-protector-strong",
32    "-D_FORTIFY_SOURCE=2",
33    "-Os",
34  ]
35
36  cflags_cc = [ "-Os" ]
37}
38
39config("app_domain_verify_agent_client_config") {
40  visibility = [ ":*" ]
41  include_dirs = [
42    "include",
43    "${app_domain_verify_service_path}/include/agent/core",
44    "${app_domain_verify_service_path}/include/agent/zidl",
45    "${app_domain_verify_common_path}/include",
46    "${app_domain_verify_common_path}/include/zidl",
47    "${app_domain_verify_frameworks_common_path}/include/dfx",
48  ]
49  cflags = [
50    "-fdata-sections",
51    "-ffunction-sections",
52    "-Os",
53  ]
54  if (!app_domain_verify_feature_target_from_cloud) {
55    cflags += [ "-D_CUT_LINK_CONVERT_" ]
56  }
57  cflags_cc = [ "-Os" ]
58}
59
60ohos_shared_library("app_domain_verify_mgr_client") {
61  branch_protector_ret = "pac_ret"
62  sources = [
63    "${app_domain_verify_service_path}/src/manager/zidl/app_domain_verify_mgr_service_proxy.cpp",
64    "src/app_domain_verify_mgr_client.cpp",
65  ]
66  configs = [ ":app_domain_verify_mgr_client_config" ]
67  public_configs = [ ":app_domain_verify_mgr_client_config" ]
68  deps = [ "${app_domain_verify_common_path}:app_domain_verify_common" ]
69
70  external_deps = [
71    "ability_base:want",
72    "ability_base:zuri",
73    "bundle_framework:appexecfwk_base",
74    "c_utils:utils",
75    "hilog:libhilog",
76    "hisysevent:libhisysevent",
77    "ipc:ipc_core",
78    "samgr:samgr_proxy",
79  ]
80  defines = []
81  if (build_variant == "user") {
82    defines += [ "IS_RELEASE_VERSION" ]
83  }
84  version_script = "mgr.versionscript"
85  sanitize = {
86    cfi = true
87    cfi_cross_dso = true
88    debug = false
89  }
90  subsystem_name = "bundlemanager"
91  part_name = "app_domain_verify"
92}
93
94ohos_shared_library("app_domain_verify_agent_client") {
95  branch_protector_ret = "pac_ret"
96  sources = [
97    "${app_domain_verify_service_path}/src/agent/zidl/app_domain_verify_agent_service_proxy.cpp",
98    "src/app_domain_verify_agent_client.cpp",
99  ]
100  configs = [ ":app_domain_verify_agent_client_config" ]
101  public_configs = [ ":app_domain_verify_agent_client_config" ]
102  deps = [ "${app_domain_verify_common_path}:app_domain_verify_common" ]
103  version_script = "agent.versionscript"
104  external_deps = [
105    "ability_base:want",
106    "bundle_framework:appexecfwk_base",
107    "c_utils:utils",
108    "hilog:libhilog",
109    "hisysevent:libhisysevent",
110    "ipc:ipc_core",
111    "samgr:samgr_proxy",
112  ]
113  defines = []
114  if (build_variant == "user") {
115    defines += [ "IS_RELEASE_VERSION" ]
116  }
117  sanitize = {
118    cfi = true
119    cfi_cross_dso = true
120    debug = false
121  }
122  subsystem_name = "bundlemanager"
123  part_name = "app_domain_verify"
124}
125