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