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 "src/risk_analysis_manager_proxy.cpp", 46 ] 47 48 sanitize = { 49 integer_overflow = true 50 ubsan = true 51 boundary_sanitize = true 52 cfi = true 53 cfi_cross_dso = true 54 debug = false 55 } 56 branch_protector_ret = "pac_ret" 57 58 external_deps = [ 59 "c_utils:utils", 60 "hilog:libhilog", 61 "ipc:ipc_core", 62 "samgr:samgr_proxy", 63 ] 64} 65 66ohos_shared_library("libsg_classify_sdk") { 67 innerapi_tags = [ 68 "platformsdk", 69 "sasdk", 70 ] 71 subsystem_name = "security" 72 part_name = "security_guard" 73 output_name = "libsg_classify_sdk" 74 75 configs = [ "${sg_root_dir}/resource/config/build:coverage_flags" ] 76 77 public_configs = [ ":security_guard_config" ] 78 79 include_dirs = [ 80 "include", 81 "${sg_root_dir}/services/risk_classify/include", 82 "${sg_root_dir}/frameworks/common/constants/include", 83 "${sg_root_dir}/frameworks/common/log/include", 84 "${sg_root_dir}/interfaces/inner_api/common/include", 85 "${sg_root_dir}/interfaces/inner_api/classify/include", 86 ] 87 88 sources = [ "src/sg_classify_client.cpp" ] 89 90 deps = [] 91 defines = [] 92 if (security_guard_trim_model_analysis) { 93 defines += [ "SECURITY_GUARD_TRIM_MODEL_ANALYSIS" ] 94 } 95 if (!security_guard_trim_model_analysis) { 96 deps += [ "${sg_root_dir}/frameworks/common/classify:sg_classify_stamp" ] 97 } 98 sanitize = { 99 integer_overflow = true 100 ubsan = true 101 boundary_sanitize = true 102 cfi = true 103 cfi_cross_dso = true 104 debug = false 105 } 106 branch_protector_ret = "pac_ret" 107 108 external_deps = [ 109 "c_utils:utils", 110 "hilog:libhilog", 111 "ipc:ipc_core", 112 "samgr:samgr_proxy", 113 ] 114} 115