1# Copyright (c) 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("account_iam_kit_config") {
18  include_dirs = [ "include" ]
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
34ohos_shared_library("account_iam_napi") {
35  configs = [ ":account_iam_kit_config" ]
36  public_configs = [ ":account_iam_kit_config" ]
37  sources = [
38    "${account_iam_kits_path}/src/napi_account_iam_common.cpp",
39    "${account_iam_kits_path}/src/napi_account_iam_constant.cpp",
40    "${account_iam_kits_path}/src/napi_account_iam_identity_manager.cpp",
41    "${account_iam_kits_path}/src/napi_account_iam_module.cpp",
42    "${account_iam_kits_path}/src/napi_account_iam_user_auth.cpp",
43  ]
44
45  defines = [
46    "ACCOUNT_LOG_TAG = \"AccountIAM\"",
47    "LOG_DOMAIN = 0xD001B00",
48  ]
49
50  deps = [
51    "${account_iam_framework_path}:account_iam_innerkits",
52    "${account_napi_common_path}:account_napi_common",
53  ]
54
55  external_deps = [
56    "c_utils:utils",
57    "hilog:libhilog",
58    "ipc:ipc_core",
59    "napi:ace_napi",
60  ]
61
62  cflags_cc = []
63  if (has_pin_auth_part) {
64    cflags_cc += [ "-DHAS_PIN_AUTH_PART" ]
65    sources += [
66      "${account_iam_kits_path}/src/napi_account_iam_inputer_manager.cpp",
67      "${account_iam_kits_path}/src/napi_account_iam_pin_auth.cpp",
68    ]
69    external_deps += [ "pin_auth:pinauth_framework" ]
70  }
71  if (has_user_auth_part) {
72    cflags_cc += [ "-DHAS_USER_AUTH_PART" ]
73    external_deps += [ "user_auth_framework:userauth_client" ]
74  }
75
76  subsystem_name = "account"
77  innerapi_tags = [ "platformsdk" ]
78  part_name = "os_account"
79}
80