1# Copyright (c) 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("//base/security/security_guard/security_guard.gni") 15import("//build/ohos.gni") 16 17ohos_shared_library("securityguard_napi") { 18 include_dirs = [ 19 "${sg_root_dir}/frameworks/common/constants/include", 20 "${sg_root_dir}/frameworks/js/napi", 21 "${sg_root_dir}/frameworks/common/log/include", 22 ] 23 24 sources = [ 25 "napi_request_data_manager.cpp", 26 "napi_security_event_querier.cpp", 27 "security_guard_napi.cpp", 28 "security_guard_sdk_adaptor.cpp", 29 ] 30 defines = [] 31 if (security_guard_trim_model_analysis) { 32 defines += [ "SECURITY_GUARD_TRIM_MODEL_ANALYSIS" ] 33 } 34 sanitize = { 35 integer_overflow = true 36 ubsan = true 37 boundary_sanitize = true 38 cfi = true 39 cfi_cross_dso = true 40 debug = false 41 } 42 branch_protector_ret = "pac_ret" 43 44 deps = [ 45 "${sg_root_dir}/frameworks/common/classify:libsg_classify_sdk", 46 "${sg_root_dir}/frameworks/common/collect:libsg_collect_sdk", 47 ] 48 49 external_deps = [ 50 "c_utils:utils", 51 "hilog:libhilog", 52 "ipc:ipc_core", 53 "napi:ace_napi", 54 "samgr:samgr_proxy", 55 ] 56 57 relative_install_dir = "module/security" 58 subsystem_name = "security" 59 part_name = "security_guard" 60} 61