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("../../core/transmission/trans_channel/trans_channel.gni")
16import("../../dsoftbus.gni")
17
18native_source_path = rebase_path("$dsoftbus_root_path")
19broadcast_dep_dir = "dsoftbus_enhance/core/broadcast/notification_message"
20enhanced_broadcast = exec_script("$dsoftbus_root_path/check_sub_module.py",
21                                 [
22                                   "$native_source_path",
23                                   "$broadcast_dep_dir",
24                                 ],
25                                 "value")
26
27qos_info_dep_dir = "dsoftbus_enhance/core/transmission/trans_channel/common"
28enhanced_qos_info = exec_script("$dsoftbus_root_path/check_sub_module.py",
29                                [
30                                  "$native_source_path",
31                                  "$qos_info_dep_dir",
32                                ],
33                                "value")
34
35trans_session_src = trans_channel_src
36trans_session_inc = trans_channel_inc
37trans_session_deps = trans_channel_deps
38trans_session_deps += [ "$dsoftbus_dfx_path/log:softbus_dfx_log" ]
39trans_session_external_deps = []
40
41trans_session_src += [
42  "$dsoftbus_root_path/core/transmission/session/src/trans_session_manager.c",
43  "$dsoftbus_root_path/core/transmission/session/src/trans_session_service.c",
44]
45trans_session_inc += [
46  "$dsoftbus_root_path/core/transmission/ipc/include",
47  "$dsoftbus_root_path/core/transmission/session/include",
48  "$dsoftbus_root_path/core/transmission/interface",
49]
50
51if (enhanced_qos_info) {
52  trans_session_src += [ "$dsoftbus_root_path/dsoftbus_enhance/core/transmission/trans_channel/common/src/trans_qos_info.c" ]
53  trans_session_inc +=
54      [ "$dsoftbus_root_path/dsoftbus_enhance/interfaces/kits/transport" ]
55} else {
56  trans_session_src += [ "$dsoftbus_root_path/core/transmission/trans_channel/common/src/trans_qos_info.c" ]
57}
58
59if (defined(ohos_lite)) {
60  if (ohos_kernel_type == "liteos_m") {
61    trans_session_src += [
62      "$dsoftbus_root_path/core/transmission/ipc/mini/trans_client_proxy.c",
63    ]
64    trans_session_inc +=
65        [ "$dsoftbus_root_path/sdk/transmission/trans_channel/manager/include" ]
66    trans_session_deps += [ "//build/lite/config/component/cJSON:cjson_static" ]
67  } else {
68    trans_session_src += [
69      "$dsoftbus_root_path/core/transmission/ipc/small/trans_client_proxy.c",
70    ]
71    trans_session_deps += [
72      "//build/lite/config/component/cJSON:cjson_shared",
73      "//foundation/communication/ipc/interfaces/innerkits/c/ipc:ipc_single",
74    ]
75  }
76} else {
77  trans_session_inc += [
78    "$dsoftbus_root_path/core/transmission/ipc/$os_type/include",
79    "$dsoftbus_root_path/sdk/frame/$os_type/include",
80    "$dsoftbus_root_path/sdk/transmission/trans_channel/tcp_direct",
81  ]
82  trans_session_src += [
83    "$dsoftbus_root_path/core/transmission/ipc/$os_type/src/trans_client_proxy.cpp",
84    "$dsoftbus_root_path/core/transmission/ipc/$os_type/src/trans_client_proxy_standard.cpp",
85  ]
86  if (enhanced_broadcast) {
87    import(
88        "$dsoftbus_root_path/dsoftbus_enhance/core/broadcast/notification_message/notification_message.gni")
89
90    trans_session_src += broadcast_sources
91    trans_session_inc += broadcast_include_dirs
92    trans_session_deps +=
93        [ "$dsoftbus_root_path/components/nstackx/nstackx_ctrl:nstackx_ctrl" ]
94  } else {
95    trans_session_inc +=
96        [ "$dsoftbus_root_path/core/transmission/broadcast/include" ]
97    trans_session_src += [ "$dsoftbus_root_path/core/transmission/broadcast/src/trans_spec_object_stub.cpp" ]
98  }
99  trans_session_external_deps += [
100    "bounds_checking_function:libsec_shared",
101    "cJSON:cjson",
102    "c_utils:utils",
103  ]
104}
105
106if (dsoftbus_feature_wifi_notify == true &&
107    softbus_communication_wifi_feature == true) {
108  trans_session_src += [ "$dsoftbus_root_path/core/transmission/session/src/softbus_scenario_manager.c" ]
109  trans_session_external_deps += [ "wifi:wifi_sdk" ]
110} else {
111  trans_session_src += [ "$dsoftbus_root_path/core/transmission/session/src/softbus_scenario_manager_virtual.c" ]
112}
113