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_extension_config") {
18  defines = []
19  if (target_cpu == "arm64") {
20    defines += [ "APP_USE_ARM64" ]
21  } else if (target_cpu == "arm") {
22    defines += [ "APP_USE_ARM" ]
23  } else if (target_cpu == "x86_64") {
24    defines += [ "APP_USE_X86_64" ]
25  }
26  cflags = [
27    "-fdata-sections",
28    "-ffunction-sections",
29    "-Os",
30  ]
31
32  cflags_cc = [ "-Os" ]
33}
34
35config("app_domain_verify_extension_public_config") {
36  visibility = [ ":*" ]
37  include_dirs = [
38    "include",
39    "${app_domain_verify_common_path}/include",
40    "${app_domain_verify_common_path}/include/zidl",
41  ]
42}
43
44ohos_shared_library("app_domain_verify_extension_framework") {
45  branch_protector_ret = "pac_ret"
46  sources = [
47    "src/app_domain_verify_agent_ext.cpp",
48    "src/app_domain_verify_extension_mgr.cpp",
49    "src/app_domain_verify_extension_register.cpp",
50  ]
51  configs = [ ":app_domain_verify_extension_config" ]
52  public_configs = [ ":app_domain_verify_extension_public_config" ]
53  deps = [ "${app_domain_verify_common_path}:app_domain_verify_common" ]
54  version_script = "extension.versionscript"
55  external_deps = [
56    "ability_base:want",
57    "c_utils:utils",
58    "hilog:libhilog",
59    "hisysevent:libhisysevent",
60    "ipc:ipc_single",
61    "samgr:samgr_proxy",
62  ]
63  defines = []
64  if (build_variant == "user") {
65    defines += [ "IS_RELEASE_VERSION" ]
66  }
67  sanitize = {
68    cfi = true
69    cfi_cross_dso = true
70    debug = false
71  }
72  subsystem_name = "bundlemanager"
73  part_name = "app_domain_verify"
74}
75