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/json/include",
30    "${sg_root_dir}/frameworks/common/task_handler/include",
31    "${sg_root_dir}/frameworks/common/database/include",
32    "${sg_root_dir}/frameworks/common/log/include",
33    "${sg_root_dir}/frameworks/common/utils/include",
34    "${sg_root_dir}/services/config_manager/include",
35    "${sg_root_dir}/services/data_collect/store/include",
36    "${sg_root_dir}/services/risk_classify/model_manager",
37    "${sg_root_dir}/interfaces/inner_api/common/include",
38    "${sg_root_dir}/interfaces/inner_api/classify/include",
39  ]
40
41  sources = [
42    "${sg_root_dir}/services/risk_classify/model_manager/src/config_operate.cpp",
43    "${sg_root_dir}/services/risk_classify/model_manager/src/db_operate.cpp",
44    "${sg_root_dir}/services/risk_classify/model_manager/src/model_manager.cpp",
45    "${sg_root_dir}/services/risk_classify/model_manager/src/model_manager_impl.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  deps = [ "${sg_root_dir}/services/config_manager:sg_config_manager" ]
59
60  external_deps = [
61    "c_utils:utils",
62    "hilog:libhilog",
63    "json:nlohmann_json_static",
64    "relational_store:native_rdb",
65  ]
66}
67