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("//base/security/security_guard/security_guard.gni") 15import("//build/ohos.gni") 16 17config("security_guard_config") { 18 visibility = [ ":*" ] 19 include_dirs = [ 20 "${sg_root_dir}/interfaces/inner_api/classify/include", 21 "${sg_root_dir}/interfaces/inner_api/common/include", 22 ] 23} 24 25ohos_source_set("sg_classify_stamp") { 26 subsystem_name = "security" 27 part_name = "security_guard" 28 29 configs = [ "${sg_root_dir}/resource/config/build:coverage_flags" ] 30 31 public_configs = [ ":security_guard_config" ] 32 33 include_dirs = [ 34 "include", 35 "${sg_root_dir}/services/risk_classify/include", 36 "${sg_root_dir}/frameworks/common/constants/include", 37 "${sg_root_dir}/frameworks/common/log/include", 38 "${sg_root_dir}/interfaces/inner_api/common/include", 39 "${sg_root_dir}/interfaces/inner_api/classify/include", 40 ] 41 42 sources = [ 43 "src/risk_analysis_manager_callback_service.cpp", 44 "src/risk_analysis_manager_callback_stub.cpp", 45 ] 46 47 deps = [ "${sg_root_dir}/services/risk_classify/idl:risk_analysis_manager_idl_sa_proxy" ] 48 49 sanitize = { 50 integer_overflow = true 51 ubsan = true 52 boundary_sanitize = true 53 cfi = true 54 cfi_cross_dso = true 55 debug = false 56 } 57 branch_protector_ret = "pac_ret" 58 59 external_deps = [ 60 "c_utils:utils", 61 "hilog:libhilog", 62 "ipc:ipc_core", 63 "samgr:samgr_proxy", 64 ] 65} 66 67ohos_shared_library("libsg_classify_sdk") { 68 innerapi_tags = [ 69 "platformsdk", 70 "sasdk", 71 ] 72 subsystem_name = "security" 73 part_name = "security_guard" 74 output_name = "libsg_classify_sdk" 75 version_script = "sg_classify_sdk.map" 76 77 configs = [ "${sg_root_dir}/resource/config/build:coverage_flags" ] 78 79 public_configs = [ ":security_guard_config" ] 80 81 include_dirs = [ 82 "include", 83 "${sg_root_dir}/services/risk_classify/include", 84 "${sg_root_dir}/frameworks/common/constants/include", 85 "${sg_root_dir}/frameworks/common/log/include", 86 "${sg_root_dir}/interfaces/inner_api/common/include", 87 "${sg_root_dir}/interfaces/inner_api/classify/include", 88 ] 89 90 sources = [ "src/sg_classify_client.cpp" ] 91 92 deps = [ "${sg_root_dir}/services/risk_classify/idl:risk_analysis_manager_idl_sa_proxy" ] 93 defines = [] 94 if (security_guard_trim_model_analysis) { 95 defines += [ "SECURITY_GUARD_TRIM_MODEL_ANALYSIS" ] 96 } 97 if (!security_guard_trim_model_analysis) { 98 deps += [ "${sg_root_dir}/frameworks/common/classify:sg_classify_stamp" ] 99 } 100 sanitize = { 101 integer_overflow = true 102 ubsan = true 103 boundary_sanitize = true 104 cfi = true 105 cfi_cross_dso = true 106 debug = false 107 } 108 branch_protector_ret = "pac_ret" 109 110 external_deps = [ 111 "c_utils:utils", 112 "hilog:libhilog", 113 "ipc:ipc_core", 114 "samgr:samgr_proxy", 115 ] 116} 117