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