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_common_config") {
18  visibility = [ ":*" ]
19  include_dirs = [
20    "include",
21    "include/zidl",
22    "${app_domain_verify_frameworks_common_path}/include",
23    "${app_domain_verify_frameworks_common_path}/include/dfx",
24  ]
25  cflags = [
26    "-fdata-sections",
27    "-ffunction-sections",
28    "-fstack-protector-strong",
29    "-D_FORTIFY_SOURCE=2",
30    "-Os",
31  ]
32
33  cflags_cc = [ "-Os" ]
34}
35
36ohos_shared_library("app_domain_verify_common") {
37  branch_protector_ret = "pac_ret"
38  sources = [
39    "src/app_verify_base_info.cpp",
40    "src/bundle_verify_status_info.cpp",
41    "src/common_utils.cpp",
42    "src/skill_uri.cpp",
43    "src/zidl/convert_callback_proxy.cpp",
44    "src/zidl/convert_callback_stub.cpp",
45  ]
46
47  public_configs = [ ":app_domain_verify_common_config" ]
48  version_script = "common.versionscript"
49
50  external_deps = [
51    "ability_base:want",
52    "c_utils:utils",
53    "hilog:libhilog",
54    "hisysevent:libhisysevent",
55    "ipc:ipc_core",
56    "json:nlohmann_json_static",
57    "safwk:system_ability_fwk",
58    "samgr:samgr_proxy",
59  ]
60  defines = []
61  if (build_variant == "user") {
62    defines += [ "IS_RELEASE_VERSION" ]
63  }
64  sanitize = {
65    cfi = true
66    cfi_cross_dso = true
67    debug = false
68  }
69  subsystem_name = "bundlemanager"
70  part_name = "app_domain_verify"
71}
72