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/hisysevent_adapter.cpp", 54 "modules/load_mode/src/load_mode_handler.cpp", 55 "modules/load_mode/src/system_param_manager.cpp", 56 "sa/src/pin_auth_service.cpp", 57 ] 58 59 defines = [] 60 61 if (pin_auth_enable_dynamic_load) { 62 sources += [ 63 "modules/load_mode/src/driver_load_manager.cpp", 64 "modules/load_mode/src/load_mode_handler_dynamic.cpp", 65 "modules/load_mode/src/relative_timer.cpp", 66 "modules/load_mode/src/system_ability_listener.cpp", 67 ] 68 defines += [ "ENABLE_DYNAMIC_LOAD" ] 69 } else { 70 sources += [ "modules/load_mode/src/load_mode_handler_default.cpp" ] 71 } 72 73 configs = [ 74 ":pin_auth_services_config", 75 "../common:iam_log_config", 76 "../common:iam_utils_config", 77 ] 78 79 public_configs = [ ":pin_auth_services_config" ] 80 81 deps = [ "../frameworks:pinauth_ipc" ] 82 83 external_deps = [ 84 "access_token:libaccesstoken_sdk", 85 "c_utils:utils", 86 "device_manager:devicemanagersdk", 87 "drivers_interface_pin_auth:libpin_auth_proxy_3.0", 88 "hdf_core:libhdf_utils", 89 "hdf_core:libhdi", 90 "hilog:libhilog", 91 "hisysevent:libhisysevent", 92 "init:libbeget_proxy", 93 "init:libbegetutil", 94 "ipc:ipc_single", 95 "openssl:libcrypto_shared", 96 "safwk:system_ability_fwk", 97 "samgr:samgr_proxy", 98 "user_auth_framework:userauth_executors", 99 ] 100 101 if (sensors_miscdevice_enable) { 102 external_deps += [ "miscdevice:vibrator_interface_native" ] 103 defines += [ "SENSORS_MISCDEVICE_ENABLE" ] 104 } 105 106 remove_configs = [ "//build/config/compiler:no_exceptions" ] 107 108 subsystem_name = "useriam" 109 part_name = "pin_auth" 110} 111 112ohos_shared_library("pinauthservice") { 113 sanitize = { 114 integer_overflow = true 115 ubsan = true 116 boundary_sanitize = true 117 cfi = true 118 cfi_cross_dso = true 119 debug = false 120 blocklist = "../cfi_blocklist.txt" 121 } 122 branch_protector_ret = "pac_ret" 123 deps = [ ":pinauthservice_source_set" ] 124 125 external_deps = [ "hilog:libhilog" ] 126 127 public_configs = [ ":pin_auth_services_config" ] 128 129 if (use_musl) { 130 version_script = "pin_auth_service_map" 131 } 132 133 subsystem_name = "useriam" 134 part_name = "pin_auth" 135} 136