• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021 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("//foundation/communication/dsoftbus/dsoftbus.gni")
15
16import("//foundation/communication/dsoftbus/sdk/bus_center/bus_center_sdk.gni")
17import("//foundation/communication/dsoftbus/sdk/discovery/disc_sdk.gni")
18import("//foundation/communication/dsoftbus/sdk/frame/frame_sdk.gni")
19import("//foundation/communication/dsoftbus/sdk/transmission/trans_sdk.gni")
20
21common_client_src = bus_center_sdk_src + disc_sdk_src +
22                    softbus_client_frame_src + trans_session_manager_sdk_src
23common_client_inc = bus_center_sdk_inc + disc_sdk_inc +
24                    softbus_client_frame_inc + trans_session_manager_sdk_inc
25common_client_deps = bus_center_sdk_deps + trans_session_manager_sdk_deps
26
27common_client_deps += [
28  "$dsoftbus_root_path/adapter:softbus_adapter",
29  "$dsoftbus_root_path/core/common:softbus_utils",
30]
31
32if (defined(ohos_lite)) {
33  if (dsoftbus_standard_feature_build_shared_sdk == true) {
34    build_type = "shared_library"
35  } else {
36    build_type = "static_library"
37  }
38  if (ohos_kernel_type != "liteos_m") {
39    common_client_deps += [
40      "//foundation/communication/ipc_lite:liteipc_adapter",
41      "//foundation/distributedschedule/samgr_lite/samgr:samgr",
42      "//third_party/bounds_checking_function:libsec_shared",
43    ]
44  }
45} else {
46  if (dsoftbus_standard_feature_build_shared_sdk == true) {
47    build_type = "ohos_shared_library"
48  } else {
49    build_type = "ohos_static_library"
50  }
51  common_client_deps += [
52    "//utils/native/base:utils",
53    "//utils/native/base:utilsecurec_shared",
54  ]
55}
56
57config("dsoftbus_sdk_interface") {
58  include_dirs = [
59    "$dsoftbus_root_path/interfaces/kits",
60    "$dsoftbus_root_path/interfaces/kits/bus_center",
61    "$dsoftbus_root_path/interfaces/kits/common",
62    "$dsoftbus_root_path/interfaces/kits/discovery",
63    "$dsoftbus_root_path/interfaces/kits/transport",
64    "$dsoftbus_root_path/sdk/transmission/session/cpp/include",
65    "$dsoftbus_root_path/interfaces/inner_kits/transport",
66  ]
67}
68
69target(build_type, "softbus_client") {
70  sources = common_client_src
71  include_dirs = common_client_inc
72  deps = common_client_deps
73  public_configs = [ ":dsoftbus_sdk_interface" ]
74  defines = TRANS_SDK_DEFINES
75
76  if (defined(ohos_lite)) {
77    configs -= [ "//build/lite/config:language_cpp" ]
78    cflags = [ "-fPIC" ]
79    cflags_cc = [
80      "-std=c++14",
81      "-fPIC",
82    ]
83    ldflags = [ "-lstdc++" ]
84  } else {
85    cflags = [ "-fPIC" ]
86    cflags_cc = [ "-std=c++14" ]
87    if (is_standard_system) {
88      external_deps = [
89        "hiviewdfx_hilog_native:libhilog",
90        "ipc:ipc_single",
91      ]
92    }
93    part_name = "dsoftbus_standard"
94    subsystem_name = "communication"
95  }
96}
97