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_model_configs") {
18  include_dirs = [
19    "${sg_root_dir}/services/risk_classify/model_manager/include",
20    "${sg_root_dir}/services/config_manager/include",
21  ]
22}
23
24ohos_shared_library("sg_classify_service") {
25  subsystem_name = "security"
26  part_name = "security_guard"
27
28  version_script = "sg_classify_service.map"
29
30  configs = [ "${sg_root_dir}/resource/config/build:coverage_flags" ]
31
32  include_dirs = [
33    "${sg_root_dir}/services/bigdata/include",
34    "${sg_root_dir}/interfaces/inner_api/classify/include",
35    "${sg_root_dir}/services/config_manager/include",
36    "${sg_root_dir}/services/risk_classify/include",
37    "${sg_root_dir}/services/risk_classify/model_manager/include",
38    "${sg_root_dir}/services/risk_collect/include",
39    "${sg_root_dir}/services/data_collect/store/include",
40    "${sg_root_dir}/frameworks/common/database/include",
41    "${sg_root_dir}/frameworks/common/log/include",
42    "${sg_root_dir}/frameworks/common/constants/include",
43    "${sg_root_dir}/frameworks/common/task_handler/include",
44    "${sg_root_dir}/frameworks/common/utils/include",
45    "${sg_root_dir}/frameworks/common/interfaces",
46    "${sg_root_dir}/frameworks/common/json/include",
47  ]
48
49  sources = [
50    "${sg_root_dir}/frameworks/common/utils/src/security_guard_utils.cpp",
51    "${sg_root_dir}/services/risk_classify/src/risk_analysis_manager_callback_proxy.cpp",
52    "${sg_root_dir}/services/risk_classify/src/risk_analysis_manager_service.cpp",
53    "${sg_root_dir}/services/risk_classify/src/risk_analysis_manager_stub.cpp",
54    "${sg_root_dir}/services/risk_classify/src/risk_analysis_model.cpp",
55  ]
56
57  sanitize = {
58    integer_overflow = true
59    ubsan = true
60    boundary_sanitize = true
61    cfi = true
62    cfi_cross_dso = true
63    debug = false
64  }
65  stack_protector_ret = true
66
67  deps = [
68    "${sg_root_dir}/frameworks/common/task_handler:sg_task_stamp",
69    "${sg_root_dir}/services/bigdata:sg_bigdata_stamp",
70    "${sg_root_dir}/services/config_manager:sg_config_manager",
71    "${sg_root_dir}/services/data_collect:sg_collect_service",
72    "${sg_root_dir}/services/risk_classify/model_manager:sg_model_manager_stamp",
73  ]
74
75  external_deps = [
76    "access_token:libaccesstoken_sdk",
77    "access_token:libtokenid_sdk",
78    "c_utils:utils",
79    "hilog:libhilog",
80    "ipc:ipc_core",
81    "json:nlohmann_json_static",
82    "relational_store:native_rdb",
83    "safwk:system_ability_fwk",
84    "samgr:samgr_proxy",
85  ]
86}
87