• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2022-2024 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
17declare_args() {
18  pin_auth_enabled = true
19}
20
21config("pin_auth_services_config") {
22  include_dirs = [
23    "sa/inc",
24    "modules/common/inc",
25    "modules/driver/inc",
26    "modules/executors/inc",
27    "modules/inputters/inc",
28    "modules/load_mode/inc",
29  ]
30}
31
32ohos_source_set("pinauthservice_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    "modules/driver/src/pin_auth_driver_hdi.cpp",
45    "modules/driver/src/pin_auth_interface_adapter.cpp",
46    "modules/executors/src/pin_auth_all_in_one_hdi.cpp",
47    "modules/executors/src/pin_auth_collector_hdi.cpp",
48    "modules/executors/src/pin_auth_executor_callback_hdi.cpp",
49    "modules/executors/src/pin_auth_executor_hdi_common.cpp",
50    "modules/executors/src/pin_auth_verifier_hdi.cpp",
51    "modules/inputters/src/i_inputer_data_impl.cpp",
52    "modules/inputters/src/pin_auth_manager.cpp",
53    "modules/load_mode/src/load_mode_handler.cpp",
54    "modules/load_mode/src/system_param_manager.cpp",
55    "sa/src/pin_auth_service.cpp",
56  ]
57
58  defines = []
59
60  if (pin_auth_enable_dynamic_load) {
61    sources += [
62      "modules/load_mode/src/driver_load_manager.cpp",
63      "modules/load_mode/src/load_mode_handler_dynamic.cpp",
64      "modules/load_mode/src/relative_timer.cpp",
65      "modules/load_mode/src/system_ability_listener.cpp",
66    ]
67    defines += [ "ENABLE_DYNAMIC_LOAD" ]
68  } else {
69    sources += [ "modules/load_mode/src/load_mode_handler_default.cpp" ]
70  }
71
72  configs = [
73    ":pin_auth_services_config",
74    "../common:iam_log_config",
75    "../common:iam_utils_config",
76  ]
77
78  public_configs = [ ":pin_auth_services_config" ]
79
80  deps = [ "../frameworks:pinauth_ipc" ]
81
82  external_deps = [
83    "access_token:libaccesstoken_sdk",
84    "c_utils:utils",
85    "device_manager:devicemanagersdk",
86    "drivers_interface_pin_auth:libpin_auth_proxy_2.1",
87    "hdf_core:libhdi",
88    "hilog:libhilog",
89    "init:libbeget_proxy",
90    "init:libbegetutil",
91    "ipc:ipc_single",
92    "openssl:libcrypto_shared",
93    "safwk:system_ability_fwk",
94    "samgr:samgr_proxy",
95    "user_auth_framework:userauth_executors",
96  ]
97
98  if (sensors_miscdevice_enable) {
99    external_deps += [ "miscdevice:vibrator_interface_native" ]
100    defines += [ "SENSORS_MISCDEVICE_ENABLE" ]
101  }
102
103  remove_configs = [ "//build/config/compiler:no_exceptions" ]
104
105  subsystem_name = "useriam"
106  part_name = "pin_auth"
107}
108
109ohos_shared_library("pinauthservice") {
110  sanitize = {
111    integer_overflow = true
112    ubsan = true
113    boundary_sanitize = true
114    cfi = true
115    cfi_cross_dso = true
116    debug = false
117    blocklist = "../cfi_blocklist.txt"
118  }
119  branch_protector_ret = "pac_ret"
120  deps = [ ":pinauthservice_source_set" ]
121
122  external_deps = [ "hilog:libhilog" ]
123
124  public_configs = [ ":pin_auth_services_config" ]
125
126  if (use_musl) {
127    version_script = "pin_auth_service_map"
128  }
129
130  subsystem_name = "useriam"
131  part_name = "pin_auth"
132}
133