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("../../../../os_account.gni")
16import("../../os_account_service.gni")
17
18config("accountmgr_config") {
19  include_dirs = [
20    "${app_account_services_path}/include",
21    "${app_account_services_path}/include/ability_manager_adapter",
22    "${app_account_services_path}/include/appaccount",
23    "${app_account_services_path}/include/osaccount",
24    "${innerkits_path}/include",
25    "${os_account_dfx_path}/hidumper_adapter",
26    "${app_account_interfaces_native_path}/include",
27    "${os_account_dfx_path}/hisysevent_adapter",
28    "${os_account_dfx_path}/hitrace_adapter",
29    "${app_account_innerkits_native_path}/include",
30  ]
31}
32
33config("account_iam_config") {
34  include_dirs = [ "${account_iam_interfaces_native_path}/include" ]
35}
36
37config("domain_account_config") {
38  include_dirs = [
39    "${app_account_services_path}/include/domain_account",
40    "${domain_account_framework_path}/include",
41    "${domain_account_interfaces_native_path}/include",
42  ]
43}
44
45config("ability_manager_config") {
46  include_dirs = [
47    "${ability_runtime_path}/interfaces/inner_api/ability_manager/include",
48    "${ability_runtime_path}/ability_base/interfaces/inner_api/want/include",
49    "${ability_runtime_path}/services/abilitymgr/include",
50    "${ability_runtime_path}/services/common/include",
51  ]
52}
53
54config("accountmgr_public_config") {
55  visibility = [ ":*" ]
56
57  include_dirs = [
58    "${services_path}/accountmgr/include",
59    "${services_path}/accountmgr/include/appaccount",
60    "${services_path}/accountmgr/include/osaccount",
61    "${services_path}/accountmgr/include/domain_account",
62  ]
63
64  if (has_user_auth_part) {
65    include_dirs += [ "${services_path}/accountmgr/include/account_iam" ]
66  }
67}
68
69config("bundle_manager_config") {
70  include_dirs = [
71    "${services_path}/accountmgr/include/bundle_manager_adapter",
72    "${bundle_framework_path}/common/log/include",
73    "${bundle_framework_path}/interfaces/inner_api/appexecfwk_core/include",
74  ]
75}
76
77config("mock_accountmgr_config") {
78  cflags = [ "-pipe" ]
79  cflags_cc = [
80    "-Wdate-time",
81    "-Wformat=2",
82    "-Wfloat-equal",
83    "-Wshadow",
84  ]
85  if (os_account_multiple_active_accounts) {
86    cflags += [ "-DENABLE_MULTIPLE_ACTIVE_ACCOUNTS" ]
87  }
88
89  if (os_account_support_deactivate_main_os_account) {
90    cflags += [ "-DSUPPORT_STOP_MAIN_OS_ACCOUNT" ]
91  }
92
93  if (os_account_distributed_feature) {
94    cflags += [ "-DDISTRIBUTED_FEATURE_ENABLED" ]
95  }
96
97  if (os_account_enable_multiple_os_accounts || use_clang_coverage) {
98    cflags += [ "-DENABLE_MULTIPLE_OS_ACCOUNTS" ]
99  }
100
101  if (os_account_enable_default_admin_name) {
102    cflags += [ "-DENABLE_DEFAULT_ADMIN_NAME" ]
103  }
104
105  if (os_account_enable_account_short_name) {
106    cflags += [ "-DENABLE_ACCOUNT_SHORT_NAME" ]
107  }
108
109  configs = [
110    ":bundle_manager_config",
111    ":domain_account_config",
112    ":accountmgr_public_config",
113  ]
114
115  if (has_user_auth_part) {
116    cflags_cc += [
117      "-DHAS_USER_AUTH_PART",
118      "-DHAS_USER_IDM_PART",
119    ]
120    configs += [ ":account_iam_config" ]
121  }
122  if (has_kv_store_part) {
123    cflags_cc += [
124      "-DHAS_APP_ACCOUNT_PART",
125      "-DHAS_KV_STORE_PART",
126    ]
127  }
128
129  if (has_storage_service_part) {
130    cflags += [ "-DHAS_STORAGE_PART" ]
131  }
132
133  if (build_selinux) {
134    cflags += [ "-DWITH_SELINUX" ]
135  }
136
137  if (has_ces_part) {
138    cflags_cc += [ "-DHAS_CES_PART" ]
139  }
140
141  if (has_hiviewdfx_hisysevent_part) {
142    cflags_cc += [ "-DHAS_HISYSEVENT_PART" ]
143  }
144
145  if (hicollie_enable == true) {
146    cflags_cc += [ "-DHICOLLIE_ENABLE" ]
147  }
148
149  if (security_guard_enabled) {
150    cflags_cc += [ "-DSECURITY_GUARDE_ENABLE" ]
151  }
152
153  if (has_hiviewdfx_hitrace_part) {
154    cflags_cc += [ "-DHAS_HITRACE_PART" ]
155  }
156}
157