1# Copyright (c) 2022-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("../pin_auth.gni")
16
17config("pinauth_config") {
18  include_dirs = [
19    "client/inc",
20    "../interfaces/inner_api",
21    "scrypt/inc",
22  ]
23}
24
25config("pinauth_ipc_config") {
26  include_dirs = [
27    "ipc/inc",
28    "ipc/common_defines",
29  ]
30}
31
32ohos_source_set("pinauth_framework_source_set") {
33  sanitize = {
34    integer_overflow = true
35    ubsan = true
36    boundary_sanitize = true
37    cfi = true
38    cfi_cross_dso = true
39    debug = false
40    blocklist = "../cfi_blocklist.txt"
41  }
42  branch_protector_ret = "pac_ret"
43  sources = [
44    "client/src/inputer_data_impl.cpp",
45    "client/src/inputer_get_data_service.cpp",
46    "client/src/pinauth_register_impl.cpp",
47    "client/src/settings_data_manager.cpp",
48    "scrypt/src/scrypt.cpp",
49  ]
50
51  deps = [ ":pinauth_ipc" ]
52
53  external_deps = [
54    "c_utils:utils",
55    "data_share:datashare_consumer",
56    "hilog:libhilog",
57    "ipc:ipc_single",
58    "openssl:libcrypto_shared",
59    "samgr:samgr_proxy",
60    "user_auth_framework:userauth_client",
61  ]
62
63  if (customization_enterprise_device_management_enable) {
64    external_deps += [ "enterprise_device_management:edmservice_kits" ]
65    defines = [ "CUSTOMIZATION_ENTERPRISE_DEVICE_MANAGEMENT_ENABLE" ]
66  }
67
68  configs = [
69    "../common:iam_log_config",
70    "../common:iam_utils_config",
71    ":pinauth_ipc_config",
72  ]
73
74  public_configs = [ ":pinauth_config" ]
75
76  remove_configs = [ "//build/config/compiler:no_exceptions" ]
77
78  subsystem_name = "useriam"
79  part_name = "pin_auth"
80}
81
82ohos_shared_library("pinauth_framework") {
83  sanitize = {
84    integer_overflow = true
85    ubsan = true
86    boundary_sanitize = true
87    cfi = true
88    cfi_cross_dso = true
89    blocklist = "../cfi_blocklist.txt"
90    debug = false
91  }
92  branch_protector_ret = "pac_ret"
93  deps = [ ":pinauth_framework_source_set" ]
94
95  external_deps = [ "hilog:libhilog" ]
96
97  if (use_musl) {
98    version_script = "pin_auth_framework_map"
99  }
100
101  public_configs = [ ":pinauth_config" ]
102
103  subsystem_name = "useriam"
104  innerapi_tags = [ "platformsdk_indirect" ]
105  part_name = "pin_auth"
106}
107
108ohos_source_set("pinauth_ipc") {
109  sanitize = {
110    integer_overflow = true
111    ubsan = true
112    boundary_sanitize = true
113    cfi = true
114    cfi_cross_dso = true
115    debug = false
116    blocklist = "../cfi_blocklist.txt"
117  }
118  branch_protector_ret = "pac_ret"
119  include_dirs = [
120    "ipc/inc",
121    "ipc/common_defines",
122  ]
123
124  sources = [
125    "ipc/src/inputer_get_data_proxy.cpp",
126    "ipc/src/inputer_get_data_stub.cpp",
127    "ipc/src/inputer_set_data_proxy.cpp",
128    "ipc/src/inputer_set_data_stub.cpp",
129    "ipc/src/pin_auth_proxy.cpp",
130    "ipc/src/pin_auth_stub.cpp",
131  ]
132
133  configs = [ "../common:iam_log_config" ]
134  public_configs = [ ":pinauth_ipc_config" ]
135
136  external_deps = [
137    "c_utils:utils",
138    "hilog:libhilog",
139    "ipc:ipc_single",
140    "user_auth_framework:userauth_client",
141  ]
142
143  subsystem_name = "useriam"
144  part_name = "pin_auth"
145}
146