1# Copyright (c) 2021-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("../../../os_account.gni")
16
17config("os_account_core_config") {
18  visibility = [ ":*" ]
19
20  cflags = []
21  if (target_cpu == "arm") {
22    cflags += [ "-DBINDER_IPC_32BIT" ]
23  }
24
25  cflags += [ "-pipe" ]
26  cflags_cc = [
27    "-Wdate-time",
28    "-Wformat=2",
29    "-Wfloat-equal",
30    "-Wshadow",
31  ]
32
33  defines = [
34    "ACCOUNT_LOG_TAG = \"OsAccountCoreFwk\"",
35    "LOG_DOMAIN = 0xD001B00",
36  ]
37}
38
39config("os_account_core_public_config") {
40  include_dirs = [
41    "${domain_account_framework_path}/include",
42    "${domain_account_interfaces_native_path}/include",
43    "${os_account_core_path}/include",
44    "${os_account_interfaces_native_path}/include",
45    "${innerkits_path}/include",
46    "${innerkits_native_path}/include",
47  ]
48}
49
50ohos_shared_library("os_account_core") {
51  branch_protector_ret = "pac_ret"
52
53  sanitize = {
54    cfi = true
55    cfi_cross_dso = true
56    debug = false
57  }
58
59  sources = [
60    "${domain_account_framework_path}/src/domain_account_callback_service.cpp",
61    "${os_account_core_path}/src/os_account.cpp",
62    "${os_account_core_path}/src/os_account_death_recipient.cpp",
63    "${os_account_core_path}/src/os_account_event_listener.cpp",
64    "${os_account_core_path}/src/os_account_event_proxy.cpp",
65    "${os_account_core_path}/src/os_account_event_stub.cpp",
66    "${os_account_core_path}/src/os_account_proxy.cpp",
67    "${os_account_innerkits_native_path}/src/os_account_info.cpp",
68    "${os_account_innerkits_native_path}/src/os_account_subscribe_info.cpp",
69    "${os_account_innerkits_native_path}/src/os_account_subscriber.cpp",
70    "${os_account_path}/frameworks/domain_account/src/domain_account_common.cpp",
71  ]
72
73  configs = [ ":os_account_core_config" ]
74
75  public_configs = [ ":os_account_core_public_config" ]
76
77  use_exceptions = true
78
79  if (!use_clang_coverage) {
80    version_script = "libos_account_core.map"
81  }
82
83  deps = [
84    "${common_path}:libaccount_common",
85    "${innerkits_native_path}:libaccountkits",
86  ]
87
88  public_deps = [ "${domain_account_framework_path}:domain_account_innerkits" ]
89
90  external_deps = [
91    "ability_base:want",
92    "ability_runtime:wantagent_innerkits",
93    "c_utils:utils",
94    "hilog:libhilog",
95    "ipc:ipc_single",
96    "samgr:samgr_proxy",
97  ]
98
99  subsystem_name = "account"
100  part_name = "os_account"
101}
102