• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2024 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("//build/config/features.gni")
15import("//build/ohos.gni")
16import("//build/test.gni")
17import("../../dsoftbus.gni")
18import("../../sdk/bus_center/bus_center_sdk.gni")
19import("../../sdk/connection/connection_sdk.gni")
20import("../../sdk/frame/frame_sdk.gni")
21import("../../sdk/transmission/trans_sdk.gni")
22
23common_client_src = bus_center_sdk_src + softbus_client_frame_src +
24                    trans_session_manager_sdk_src + connection_sdk_src
25common_client_inc = bus_center_sdk_inc + softbus_client_frame_inc +
26                    trans_session_manager_sdk_inc + connection_sdk_inc
27common_client_deps = bus_center_sdk_deps + trans_session_manager_sdk_deps
28
29common_client_deps += [
30  "$dsoftbus_core_path/common:softbus_utils",
31  "$dsoftbus_dfx_path:softbus_dfx",
32  "$dsoftbus_root_path/adapter:softbus_adapter",
33]
34
35common_client_ex_deps = []
36
37if (defined(ohos_lite)) {
38  if (dsoftbus_feature_build_shared_sdk == true) {
39    build_type = "shared_library"
40  } else {
41    build_type = "static_library"
42  }
43  if (ohos_kernel_type != "liteos_m") {
44    common_client_ex_deps += [ "bounds_checking_function:libsec_shared" ]
45  }
46} else {
47  common_client_ex_deps += [ "bounds_checking_function:libsec_shared" ]
48}
49
50config("dsoftbus_sdk_interface") {
51  include_dirs = [
52    "$dsoftbus_dfx_path/interface/include",
53    "$dsoftbus_root_path/interfaces/inner_kits/lnn",
54    "$dsoftbus_root_path/interfaces/inner_kits/transport",
55    "$dsoftbus_root_path/interfaces/kits",
56    "$dsoftbus_root_path/interfaces/kits/bus_center",
57    "$dsoftbus_root_path/interfaces/kits/common",
58    "$dsoftbus_root_path/interfaces/kits/discovery",
59    "$dsoftbus_root_path/interfaces/kits/transport",
60    "$dsoftbus_sdk_path/transmission/session/cpp/include",
61    "$dsoftbus_root_path/interfaces/kits/connection",
62  ]
63}
64
65ohos_static_library("softbus_client_static") {
66  sanitize = {
67    cfi = true
68    cfi_cross_dso = true
69    debug = false
70  }
71  branch_protector_ret = "pac_ret"
72
73  sources = common_client_src
74  include_dirs = common_client_inc
75  deps = common_client_deps
76  external_deps = common_client_ex_deps
77  public_configs = [ ":dsoftbus_sdk_interface" ]
78  defines += TRANS_SDK_DEFINES
79
80  if (defined(ohos_lite)) {
81    cflags_cc = [ "-stdc=c++14" ]
82    if (board_toolchain_type != "iccarm") {
83      configs -= [ "//build/lite/config:language_cpp" ]
84      cflags = [ "-fPIC" ]
85      cflags_cc += [ "-fPIC" ]
86    } else {
87      cflags = [
88        "--diag_suppress",
89        "Pa153",
90      ]
91    }
92    ldflags = [ "-lstdc++" ]
93  } else {
94    cflags = [ "-fPIC" ]
95    cflags_cc = [ "-std=c++14" ]
96    if (is_standard_system) {
97      external_deps += [
98        "c_utils:utils",
99        "hilog:libhilog",
100        "ipc:ipc_single",
101      ]
102      if (dsoftbus_access_token_feature) {
103        external_deps += [
104          "access_token:libaccesstoken_sdk",
105          "access_token:libprivacy_sdk",
106          "access_token:libtokenid_sdk",
107          "cJSON:cjson_static",
108        ]
109      }
110    }
111    if (defined(global_parts_info) &&
112        defined(global_parts_info.hiviewdfx_hicollie)) {
113      external_deps += [ "hicollie:libhicollie" ]
114    }
115    part_name = "dsoftbus"
116    subsystem_name = "communication"
117  }
118}
119