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/device_security_level/common/dslm.gni")
15import("//build/ohos.gni")
16
17declare_args() {
18  device_security_level_feature_secondary_session_name = ""
19}
20
21# service_msg object
22ohos_source_set("service_msg_obj") {
23  sources = [ "dslm_messenger_wrapper.c" ]
24
25  include_dirs = [
26    "../../interfaces/inner_api/include",
27    "../include",
28  ]
29
30  deps = [
31    "../../baselib/msglib:messenger_static",
32    "../../baselib/utils:utils_static",
33  ]
34
35  if (defined(ohos_lite)) {
36    if (ohos_kernel_type == "linux" || ohos_kernel_type == "liteos_a") {
37      deps += [ "$dslm_hilog_path/featured:hilog_shared" ]
38    } else if (ohos_kernel_type == "liteos_m") {
39      deps += [ "$dslm_hilog_path/featured:hilog_static" ]
40    }
41  } else {
42    sanitize = {
43      integer_overflow = true
44      ubsan = true
45      boundary_sanitize = true
46      cfi = true
47      cfi_cross_dso = true
48      blocklist = "../../cfi_blocklist.txt"
49    }
50    branch_protector_ret = "pac_ret"
51
52    external_deps = [
53      "c_utils:utils",
54      "hilog:libhilog",
55    ]
56  }
57
58  if (device_security_level_feature_secondary_session_name != "") {
59    defines = [ "SECONDARY_SOCKET_NAME=\"${device_security_level_feature_secondary_session_name}\"" ]
60  }
61
62  configs = [ "../../common:common_configs" ]
63
64  part_name = "device_security_level"
65  subsystem_name = "security"
66}
67