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/test.gni")
16
17ohos_source_set("sg_model_manager_stamp") {
18  part_name = "security_guard"
19  subsystem_name = "security"
20
21  configs = [
22    "${sg_root_dir}/services/risk_classify:security_guard_model_configs",
23    "${sg_root_dir}/resource/config/build:coverage_flags",
24  ]
25
26  include_dirs = [
27    "include",
28    "${sg_root_dir}/frameworks/common/constants/include",
29    "${sg_root_dir}/frameworks/common/interfaces",
30    "${sg_root_dir}/frameworks/common/json/include",
31    "${sg_root_dir}/frameworks/common/task_handler/include",
32    "${sg_root_dir}/frameworks/common/database/include",
33    "${sg_root_dir}/frameworks/common/log/include",
34    "${sg_root_dir}/frameworks/common/utils/include",
35    "${sg_root_dir}/services/config_manager/include",
36    "${sg_root_dir}/services/data_collect/store/include",
37    "${sg_root_dir}/services/risk_classify/model_manager",
38  ]
39
40  sources = [
41    "${sg_root_dir}/services/risk_classify/model_manager/src/config_operate.cpp",
42    "${sg_root_dir}/services/risk_classify/model_manager/src/db_operate.cpp",
43    "${sg_root_dir}/services/risk_classify/model_manager/src/model_manager.cpp",
44    "${sg_root_dir}/services/risk_classify/model_manager/src/model_manager_impl.cpp",
45  ]
46
47  sanitize = {
48    integer_overflow = true
49    ubsan = true
50    boundary_sanitize = true
51    cfi = true
52    cfi_cross_dso = true
53    debug = false
54  }
55  stack_protector_ret = true
56
57  deps = [
58    "${sg_root_dir}/services/config_manager:sg_config_manager",
59    "${sg_root_dir}/services/data_collect:sg_collect_service",
60  ]
61
62  external_deps = [
63    "c_utils:utils",
64    "hilog:libhilog",
65    "json:nlohmann_json_static",
66    "relational_store:native_rdb",
67  ]
68}
69