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_common_config") {
18548bf93fSopenharmony_ci  visibility = [ ":*" ]
19548bf93fSopenharmony_ci  include_dirs = [
20548bf93fSopenharmony_ci    "include",
21548bf93fSopenharmony_ci    "include/zidl",
22548bf93fSopenharmony_ci    "${app_domain_verify_frameworks_common_path}/include",
23548bf93fSopenharmony_ci    "${app_domain_verify_frameworks_common_path}/include/dfx",
24548bf93fSopenharmony_ci  ]
25548bf93fSopenharmony_ci  cflags = [
26548bf93fSopenharmony_ci    "-fdata-sections",
27548bf93fSopenharmony_ci    "-ffunction-sections",
28548bf93fSopenharmony_ci    "-fstack-protector-strong",
29548bf93fSopenharmony_ci    "-D_FORTIFY_SOURCE=2",
30548bf93fSopenharmony_ci    "-Os",
31548bf93fSopenharmony_ci  ]
32548bf93fSopenharmony_ci
33548bf93fSopenharmony_ci  cflags_cc = [ "-Os" ]
34548bf93fSopenharmony_ci}
35548bf93fSopenharmony_ci
36548bf93fSopenharmony_ciohos_shared_library("app_domain_verify_common") {
37548bf93fSopenharmony_ci  branch_protector_ret = "pac_ret"
38548bf93fSopenharmony_ci  sources = [
39548bf93fSopenharmony_ci    "src/app_verify_base_info.cpp",
40548bf93fSopenharmony_ci    "src/bundle_verify_status_info.cpp",
41548bf93fSopenharmony_ci    "src/common_utils.cpp",
42548bf93fSopenharmony_ci    "src/skill_uri.cpp",
43548bf93fSopenharmony_ci    "src/zidl/convert_callback_proxy.cpp",
44548bf93fSopenharmony_ci    "src/zidl/convert_callback_stub.cpp",
45548bf93fSopenharmony_ci  ]
46548bf93fSopenharmony_ci
47548bf93fSopenharmony_ci  public_configs = [ ":app_domain_verify_common_config" ]
48548bf93fSopenharmony_ci  version_script = "common.versionscript"
49548bf93fSopenharmony_ci
50548bf93fSopenharmony_ci  external_deps = [
51548bf93fSopenharmony_ci    "ability_base:want",
52548bf93fSopenharmony_ci    "c_utils:utils",
53548bf93fSopenharmony_ci    "hilog:libhilog",
54548bf93fSopenharmony_ci    "hisysevent:libhisysevent",
55548bf93fSopenharmony_ci    "ipc:ipc_core",
56548bf93fSopenharmony_ci    "json:nlohmann_json_static",
57548bf93fSopenharmony_ci    "safwk:system_ability_fwk",
58548bf93fSopenharmony_ci    "samgr:samgr_proxy",
59548bf93fSopenharmony_ci  ]
60548bf93fSopenharmony_ci  defines = []
61548bf93fSopenharmony_ci  if (build_variant == "user") {
62548bf93fSopenharmony_ci    defines += [ "IS_RELEASE_VERSION" ]
63548bf93fSopenharmony_ci  }
64548bf93fSopenharmony_ci  sanitize = {
65548bf93fSopenharmony_ci    cfi = true
66548bf93fSopenharmony_ci    cfi_cross_dso = true
67548bf93fSopenharmony_ci    debug = false
68548bf93fSopenharmony_ci  }
69548bf93fSopenharmony_ci  subsystem_name = "bundlemanager"
70548bf93fSopenharmony_ci  part_name = "app_domain_verify"
71548bf93fSopenharmony_ci}
72