• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
17# messenger_static lib
18config("messenger_static_config") {
19  include_dirs = [ "include" ]
20}
21
22ohos_static_library("messenger_static") {
23  include_dirs = [
24    "include",
25    "src/common",
26  ]
27
28  sources = [ "src/common/messenger.c" ]
29
30  deps = [ "../utils:utils_static" ]
31
32  if (defined(ohos_lite)) {
33    sources += [
34      "src/lite/messenger_device_session_manager.c",
35      "src/lite/messenger_device_status_manager.c",
36      "src/lite/messenger_impl.c",
37    ]
38    if (ohos_kernel_type == "linux" || ohos_kernel_type == "liteos_a") {
39      deps += [
40        "$dslm_dsoftbus_path/sdk:softbus_client",
41        "$dslm_hilog_path/featured:hilog_shared",
42      ]
43    } else if (ohos_kernel_type == "liteos_m") {
44      deps += [
45        "$dslm_dsoftbus_path/sdk:softbus_client",
46        "$dslm_hilog_path/featured:hilog_static",
47      ]
48    }
49  } else {
50    sources += [
51      "src/standard/messenger_device_socket_manager.c",
52      "src/standard/messenger_device_status_manager.cpp",
53      "src/standard/messenger_impl.c",
54    ]
55    sanitize = {
56      integer_overflow = true
57      ubsan = true
58      boundary_sanitize = true
59      cfi = true
60      cfi_cross_dso = true
61      blocklist = "../../cfi_blocklist.txt"
62    }
63    branch_protector_ret = "pac_ret"
64
65    external_deps = [
66      "c_utils:utils",
67      "device_manager:devicemanagersdk",
68      "dsoftbus:softbus_client",
69      "hilog:libhilog",
70    ]
71  }
72
73  configs = [
74    "../../common:common_configs",
75    "../../common:common_lite_configs",
76  ]
77
78  public_configs = [ ":messenger_static_config" ]
79  part_name = "device_security_level"
80  subsystem_name = "security"
81}
82