• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021-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("../../access_token.gni")
16
17ohos_static_library("accesstoken_service_common") {
18  subsystem_name = "security"
19  part_name = "access_token"
20  sanitize = {
21    cfi = true
22    cfi_cross_dso = true
23    debug = false
24  }
25  branch_protector_ret = "pac_ret"
26  include_dirs = [
27    "${access_token_path}/frameworks/common/include",
28    "${access_token_path}/interfaces/innerkits/accesstoken/include",
29    "app_manager/include",
30    "database/include",
31    "handler/include",
32  ]
33
34  sources = [
35    "app_manager/src/app_manager_access_client.cpp",
36    "app_manager/src/app_manager_access_proxy.cpp",
37    "app_manager/src/app_manager_death_recipient.cpp",
38    "app_manager/src/app_state_data.cpp",
39    "app_manager/src/app_status_change_callback.cpp",
40    "app_manager/src/process_data.cpp",
41    "database/src/generic_values.cpp",
42    "database/src/memory_guard.cpp",
43    "database/src/sqlite_helper.cpp",
44    "database/src/statement.cpp",
45    "database/src/variant_value.cpp",
46  ]
47
48  cflags_cc = [ "-DHILOG_ENABLE" ]
49  configs = [ "${access_token_path}/config:coverage_flags" ]
50
51  deps = [ "//third_party/sqlite:sqlite" ]
52
53  external_deps = [
54    "c_utils:utils",
55    "hilog:libhilog",
56    "hisysevent:libhisysevent",
57    "ipc:ipc_core",
58    "safwk:system_ability_fwk",
59    "samgr:samgr_proxy",
60  ]
61  if (eventhandler_enable == true) {
62    cflags_cc += [ "-DEVENTHANDLER_ENABLE" ]
63    sources += [ "handler/src/access_event_handler.cpp" ]
64    external_deps += [ "eventhandler:libeventhandler" ]
65  }
66  if (ability_base_enable == true) {
67    include_dirs += [ "ability_manager/include" ]
68
69    sources += [
70      "ability_manager/src/ability_manager_access_client.cpp",
71      "ability_manager/src/ability_manager_access_death_recipient.cpp",
72      "ability_manager/src/ability_manager_access_proxy.cpp",
73    ]
74
75    external_deps += [ "ability_base:want" ]
76  }
77
78  if (use_musl) {
79    if (use_jemalloc && use_jemalloc_dfx_intf) {
80      cflags_cc += [ "-DCONFIG_USE_JEMALLOC_DFX_INTF" ]
81    }
82  }
83}
84