1548bf93fSopenharmony_ci# Copyright (c) 2023 Huawei Device Co., Ltd.
2548bf93fSopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License");
3548bf93fSopenharmony_ci# you may not use this file except in compliance with the License.
4548bf93fSopenharmony_ci# You may obtain a copy of the License at
5548bf93fSopenharmony_ci#
6548bf93fSopenharmony_ci#     http://www.apache.org/licenses/LICENSE-2.0
7548bf93fSopenharmony_ci#
8548bf93fSopenharmony_ci# Unless required by applicable law or agreed to in writing, software
9548bf93fSopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS,
10548bf93fSopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11548bf93fSopenharmony_ci# See the License for the specific language governing permissions and
12548bf93fSopenharmony_ci# limitations under the License.
13548bf93fSopenharmony_ci
14548bf93fSopenharmony_ciimport("//build/ohos.gni")
15548bf93fSopenharmony_ciimport("//foundation/bundlemanager/app_domain_verify/app_domain_verify.gni")
16548bf93fSopenharmony_ci
17548bf93fSopenharmony_ciconfig("app_domain_verify_extension_config") {
18548bf93fSopenharmony_ci  defines = []
19548bf93fSopenharmony_ci  if (target_cpu == "arm64") {
20548bf93fSopenharmony_ci    defines += [ "APP_USE_ARM64" ]
21548bf93fSopenharmony_ci  } else if (target_cpu == "arm") {
22548bf93fSopenharmony_ci    defines += [ "APP_USE_ARM" ]
23548bf93fSopenharmony_ci  } else if (target_cpu == "x86_64") {
24548bf93fSopenharmony_ci    defines += [ "APP_USE_X86_64" ]
25548bf93fSopenharmony_ci  }
26548bf93fSopenharmony_ci  cflags = [
27548bf93fSopenharmony_ci    "-fdata-sections",
28548bf93fSopenharmony_ci    "-ffunction-sections",
29548bf93fSopenharmony_ci    "-fstack-protector-strong",
30548bf93fSopenharmony_ci    "-D_FORTIFY_SOURCE=2",
31548bf93fSopenharmony_ci    "-Os",
32548bf93fSopenharmony_ci  ]
33548bf93fSopenharmony_ci
34548bf93fSopenharmony_ci  cflags_cc = [ "-Os" ]
35548bf93fSopenharmony_ci}
36548bf93fSopenharmony_ci
37548bf93fSopenharmony_ciconfig("app_domain_verify_extension_public_config") {
38548bf93fSopenharmony_ci  visibility = [ ":*" ]
39548bf93fSopenharmony_ci  include_dirs = [
40548bf93fSopenharmony_ci    "include",
41548bf93fSopenharmony_ci    "${app_domain_verify_common_path}/include",
42548bf93fSopenharmony_ci    "${app_domain_verify_common_path}/include/zidl",
43548bf93fSopenharmony_ci    "${app_domain_verify_frameworks_common_path}/include/dfx",
44548bf93fSopenharmony_ci  ]
45548bf93fSopenharmony_ci}
46548bf93fSopenharmony_ci
47548bf93fSopenharmony_ciohos_shared_library("app_domain_verify_extension_framework") {
48548bf93fSopenharmony_ci  branch_protector_ret = "pac_ret"
49548bf93fSopenharmony_ci  sources = [
50548bf93fSopenharmony_ci    "src/app_domain_verify_agent_ext.cpp",
51548bf93fSopenharmony_ci    "src/app_domain_verify_extension_mgr.cpp",
52548bf93fSopenharmony_ci    "src/app_domain_verify_extension_register.cpp",
53548bf93fSopenharmony_ci  ]
54548bf93fSopenharmony_ci  configs = [ ":app_domain_verify_extension_config" ]
55548bf93fSopenharmony_ci  public_configs = [ ":app_domain_verify_extension_public_config" ]
56548bf93fSopenharmony_ci  deps = [ "${app_domain_verify_common_path}:app_domain_verify_common" ]
57548bf93fSopenharmony_ci  version_script = "extension.versionscript"
58548bf93fSopenharmony_ci  external_deps = [
59548bf93fSopenharmony_ci    "ability_base:want",
60548bf93fSopenharmony_ci    "c_utils:utils",
61548bf93fSopenharmony_ci    "hilog:libhilog",
62548bf93fSopenharmony_ci    "hisysevent:libhisysevent",
63548bf93fSopenharmony_ci    "ipc:ipc_single",
64548bf93fSopenharmony_ci    "samgr:samgr_proxy",
65548bf93fSopenharmony_ci  ]
66548bf93fSopenharmony_ci  defines = []
67548bf93fSopenharmony_ci  if (build_variant == "user") {
68548bf93fSopenharmony_ci    defines += [ "IS_RELEASE_VERSION" ]
69548bf93fSopenharmony_ci  }
70548bf93fSopenharmony_ci  sanitize = {
71548bf93fSopenharmony_ci    cfi = true
72548bf93fSopenharmony_ci    cfi_cross_dso = true
73548bf93fSopenharmony_ci    debug = false
74548bf93fSopenharmony_ci  }
75548bf93fSopenharmony_ci  subsystem_name = "bundlemanager"
76548bf93fSopenharmony_ci  part_name = "app_domain_verify"
77548bf93fSopenharmony_ci}
78