• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2022-2025 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/config/components/idl_tool/idl.gni")
15import("//build/ohos.gni")
16import("../../os_account.gni")
17
18config("account_iam_innnerkits_config") {
19  visibility = [ ":*" ]
20
21  cflags = []
22  if (target_cpu == "arm") {
23    cflags += [ "-DBINDER_IPC_32BIT" ]
24  }
25
26  cflags += [ "-pipe" ]
27  cflags_cc = [
28    "-Wdate-time",
29    "-Wformat=2",
30    "-Wfloat-equal",
31    "-Wshadow",
32  ]
33
34  defines = [
35    "ACCOUNT_LOG_TAG = \"AccountIAMFwk\"",
36    "LOG_DOMAIN = 0xD001B00",
37  ]
38}
39
40config("account_iam_innerkits_public_config") {
41  visibility = [ ":*" ]
42
43  include_dirs = [
44    "${account_iam_interfaces_native_path}/include",
45    "${common_path}/utils/include",
46    "${innerkits_common}/include",
47    "${target_gen_dir}",
48  ]
49}
50
51idl_gen_interface("account_iam_interface") {
52  sources = [
53    "IAccountIAM.idl",
54    "IGetCredInfoCallback.idl",
55    "IGetEnrolledIdCallback.idl",
56    "IGetSetPropCallback.idl",
57    "IIDMCallback.idl",
58    "IPreRemoteAuthCallback.idl",
59  ]
60  log_domainid = "0xD001B00"
61  log_tag = "AccountIAMFwk"
62  subsystem_name = "account"
63  part_name = "os_account"
64}
65
66ohos_shared_library("account_iam_innerkits") {
67  branch_protector_ret = "pac_ret"
68
69  sanitize = {
70    cfi = true
71    cfi_cross_dso = true
72    debug = false
73  }
74
75  sources = [
76    "${account_iam_framework_path}/src/account_iam_callback_service.cpp",
77    "${account_iam_framework_path}/src/account_iam_info.cpp",
78    "${account_iam_framework_path}/src/account_iam_client.cpp",
79  ]
80
81  configs = [ ":account_iam_innnerkits_config" ]
82
83  public_configs = [ ":account_iam_innerkits_public_config" ]
84
85  # IDL
86  output_values = get_target_outputs(":account_iam_interface")
87  sources += filter_include(output_values,
88                            [
89                              "*_i_a_m_proxy.cpp",
90                              "*_callback_stub.cpp",
91                            ])
92
93  deps = [
94    ":account_iam_interface",
95    "${common_path}:libaccount_common",
96    "${domain_account_framework_path}:domain_account_innerkits",
97    "${innerkits_native_path}:libaccountkits",
98    "${os_account_innerkits_native_path}:os_account_innerkits",
99  ]
100
101  external_deps = [
102    "access_token:libaccesstoken_sdk",
103    "cJSON:cjson",
104    "c_utils:utils",
105    "hilog:libhilog",
106    "ipc:ipc_single",
107    "samgr:samgr_proxy",
108  ]
109
110  cflags_cc = []
111  if (has_pin_auth_part) {
112    cflags_cc += [ "-DHAS_PIN_AUTH_PART" ]
113    external_deps += [ "pin_auth:pinauth_framework" ]
114  }
115
116  if (has_user_auth_part) {
117    cflags_cc += [ "-DHAS_USER_AUTH_PART" ]
118    external_deps += [ "user_auth_framework:userauth_client" ]
119  }
120
121  innerapi_tags = [ "platformsdk_indirect" ]
122  subsystem_name = "account"
123  part_name = "os_account"
124}
125
126ohos_source_set("account_iam_stub") {
127  branch_protector_ret = "pac_ret"
128  sanitize = {
129    cfi = true
130    cfi_cross_dso = true
131    debug = false
132  }
133
134  configs = [ ":account_iam_innnerkits_config" ]
135  public_configs = [ ":account_iam_innerkits_public_config" ]
136
137  output_values = get_target_outputs(":account_iam_interface")
138  sources = filter_include(output_values, [ "*_i_a_m_stub.cpp" ])
139  deps = [ ":account_iam_interface" ]
140  external_deps = [
141    "cJSON:cjson",
142    "c_utils:utils",
143    "hilog:libhilog",
144    "ipc:ipc_single",
145    "samgr:samgr_proxy",
146  ]
147  if (has_user_auth_part) {
148    cflags_cc = [ "-DHAS_USER_AUTH_PART" ]
149    external_deps += [ "user_auth_framework:userauth_client" ]
150  }
151  subsystem_name = "account"
152  part_name = "os_account"
153}
154
155ohos_source_set("account_iam_callback_proxy") {
156  sanitize = {
157    cfi = true
158    cfi_cross_dso = true
159    debug = false
160  }
161
162  configs = [ ":account_iam_innnerkits_config" ]
163  public_configs = [ ":account_iam_innerkits_public_config" ]
164
165  output_values = get_target_outputs(":account_iam_interface")
166  sources = filter_include(output_values, [ "*_callback_proxy.cpp" ])
167  deps = [ ":account_iam_interface" ]
168  external_deps = [
169    "cJSON:cjson",
170    "c_utils:utils",
171    "hilog:libhilog",
172    "ipc:ipc_single",
173    "samgr:samgr_proxy",
174  ]
175  if (has_user_auth_part) {
176    cflags_cc = [ "-DHAS_USER_AUTH_PART" ]
177    external_deps += [ "user_auth_framework:userauth_client" ]
178  }
179  subsystem_name = "account"
180  part_name = "os_account"
181}