1# Copyright (c) 2022 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/systemabilitymgr/samgr/services/samgr/var.gni")
16
17config("all_config_samgr_common") {
18  include_dirs = [ "include" ]
19}
20
21config("config_samgr_common") {
22  include_dirs = [
23    "include",
24    "//foundation/systemabilitymgr/samgr/interfaces/innerkits/samgr_proxy/include",
25    "//foundation/systemabilitymgr/samgr/services/dfx/include",
26    "//foundation/systemabilitymgr/samgr/services/lsamgr/include",
27  ]
28}
29
30################################################################################
31ohos_shared_library("samgr_common") {
32  version_script = "libsamgr_common.versionscript"
33  sanitize = {
34    integer_overflow = true
35    boundary_sanitize = true
36    ubsan = true
37    cfi = true
38    cfi_cross_dso = true
39    debug = false
40    cfi_no_nvcall = true
41    blocklist = "../../../cfi_blocklist.txt"
42  }
43  branch_protector_ret = "pac_ret"
44
45  sources = [
46    "//foundation/systemabilitymgr/samgr/services/common/src/parse_util.cpp",
47    "//foundation/systemabilitymgr/samgr/services/dfx/source/hisysevent_adapter.cpp",
48    "//foundation/systemabilitymgr/samgr/services/dfx/source/samgr_xcollie.cpp",
49  ]
50
51  defines = []
52
53  configs = [
54    ":config_samgr_common",
55    "//foundation/systemabilitymgr/samgr/test/resource:coverage_flags",
56  ]
57
58  public_configs = [
59    ":config_samgr_common",
60    ":all_config_samgr_common",
61  ]
62
63  external_deps = [ "libxml2:libxml2" ]
64
65  all_dependent_configs = [
66    ":all_config_samgr_common",
67    "//third_party/libxml2:libxml2_config",
68  ]
69
70  if (is_standard_system) {
71    external_deps += [
72      "c_utils:utils",
73      "hilog:libhilog",
74      "hisysevent:libhisysevent",
75      "hitrace:hitrace_meter",
76    ]
77
78    if (hicollie_able) {
79      external_deps += [ "hicollie:libhicollie" ]
80      defines += [ "HICOLLIE_ENABLE" ]
81    }
82    public_external_deps = [ "json:nlohmann_json_static" ]
83    part_name = "samgr"
84  }
85
86  innerapi_tags = [ "platformsdk" ]
87  subsystem_name = "systemabilitymgr"
88}
89################################################################################
90