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