• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021-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
14hispark_pegasus_sdk_path = "//device/soc/hisilicon/hi3861v100/sdk_liteos"
15kernel_path = "//kernel/liteos_m/components/net/lwip-2.1/porting/include"
16third_party_path = "//third_party/lwip/src/include"
17build_lite_path = "//build/lite/config/component/cJSON:cjson_static"
18btframework_path = "//foundation/communication/bluetooth/frameworks/inner:btframework"
19inner_api_path = "//foundation/communication/bluetooth/interfaces/inner_api/include"
20commonlibrary_path = "//commonlibrary/utils_lite/include"
21cjson_shared_path = "//build/lite/config/component/cJSON:cjson_shared"
22ipc_single_path = "//foundation/communication/ipc/interfaces/innerkits/c/ipc:ipc_single"
23samgr_path = "//foundation/systemabilitymgr/samgr_lite/samgr:samgr"
24btframework_path = "//foundation/communication/bluetooth/frameworks/inner:btframework"
25
26dsoftbus_root_path = rebase_path(".")
27dsoftbus_sdk_path = "${dsoftbus_root_path}/sdk"
28dsoftbus_core_path = "${dsoftbus_root_path}/core"
29dsoftbus_dfx_path = "${dsoftbus_root_path}/dfx"
30dsoftbus_test_path = "${dsoftbus_root_path}/tests"
31dsoftbus_test_dfx_path = "${dsoftbus_test_path}/dfx"
32dsoftbus_fuzz_out_path = "dsoftbus/soft_bus"
33
34import("adapter/feature_config/external_deps_feature/external_deps_feature.gni")
35import("adapter/feature_config/inner_feature/conn_inner_feature.gni")
36import("adapter/feature_config/inner_feature/disc_inner_feature.gni")
37import("adapter/feature_config/inner_feature/lnn_inner_feature.gni")
38import("adapter/feature_config/inner_feature/softbus_common_feature.gni")
39import("adapter/feature_config/inner_feature/t2stack_inner_feature.gni")
40import("adapter/feature_config/inner_feature/trans_inner_feature.gni")
41import("adapter/feature_config/public_feature/public_feature.gni")
42
43declare_args() {
44  softbus_adapter_common = "${dsoftbus_root_path}/adapter/common"
45  softbus_adapter_config = "${dsoftbus_root_path}/adapter/default_config"
46  dsoftbus_feature_product_config_path =
47      "${dsoftbus_root_path}/adapter/default_config"
48}
49
50declare_args() {
51  softbus_communication_wifi_feature = true
52  softbus_os_account = true
53  dsoftbus_build_eng = false
54  dsoftbus_access_token_feature = true
55  dsoftbus_ipc_feature = true
56  softbus_config_enhance = false
57
58  if (product_name != "qemu-arm-linux-min") {
59    qemu_arm_disable = true
60  } else {
61    qemu_arm_disable = false
62  }
63}
64
65dsoftbus_feature_lnn_frame = true
66
67if (defined(global_parts_info) &&
68    !defined(global_parts_info.communication_wifi)) {
69  softbus_communication_wifi_feature = false
70}
71
72if (defined(global_parts_info) &&
73    !defined(global_parts_info.account_os_account)) {
74  softbus_os_account = false
75}
76
77if (defined(global_parts_info) &&
78    !defined(global_parts_info.communication_bluetooth)) {
79  support_bluetooth = false
80} else {
81  support_bluetooth = true
82}
83
84if (defined(global_parts_info) &&
85    !defined(global_parts_info.security_access_token)) {
86  dsoftbus_access_token_feature = false
87}
88
89if (defined(global_parts_info) &&
90    !defined(global_parts_info.communication_ipc)) {
91  dsoftbus_ipc_feature = false
92}
93
94if (defined(ohos_lite)) {
95  import("//build/lite/config/component/lite_component.gni")
96  if (ohos_kernel_type == "liteos_m") {
97    defines = [ "SOFTBUS_LITEOS_M" ]
98    import("$softbus_adapter_config/feature_config/mini/config.gni")
99  } else {
100    defines = [ "SOFTBUS_LITEOS_A" ]
101    import("$softbus_adapter_config/feature_config/small/config.gni")
102  }
103} else {
104  if (defined(os_win)) {
105    os_type = "windows"
106  } else {
107    os_type = "standard"
108  }
109  defines = [ "SOFTBUS_LINUX" ]
110  if (is_standard_system) {
111    defines += [ "SOFTBUS_STANDARD_OS" ]
112  }
113  import("//build/ohos.gni")
114  import(
115      "$dsoftbus_feature_product_config_path/feature_config/standard/config.gni")
116
117  if (build_variant == "root") {
118    defines += [ "BUILD_VARIANT_ENG" ]
119    dsoftbus_build_eng = true
120  } else {
121    dsoftbus_build_eng = false
122  }
123}
124
125defines += [ "OPENSSL_NO_FILENAMES" ]
126
127if (dsoftbus_feature_disc_coap && dsoftbus_feature_inner_disc_coap) {
128  defines += [ "DSOFTBUS_FEATURE_DISC_COAP" ]
129}
130
131if (dsoftbus_feature_disc_lnn_coap && dsoftbus_feature_inner_disc_coap) {
132  defines += [ "DSOFTBUS_FEATURE_DISC_LNN_COAP" ]
133}
134
135if (dsoftbus_feature_disc_share_coap && dsoftbus_feature_inner_disc_coap) {
136  defines += [ "DSOFTBUS_FEATURE_DISC_SHARE_COAP" ]
137}
138
139if (defined(global_parts_info) &&
140    !defined(global_parts_info.distributeddatamgr_kv_store)) {
141  dsoftbus_feature_lnn_cloud_sync = false
142} else {
143  dsoftbus_feature_lnn_cloud_sync = true
144}
145
146if (softbus_config_enhance) {
147  defines += [ "DSOFTBUS_CONFIG_ENHANCE" ]
148}
149
150import("$dsoftbus_dfx_path/dsoftbus_dfx.gni")
151if (defined(global_parts_info) &&
152    !defined(global_parts_info.notification_common_event_service)) {
153  has_ces_part = false
154} else {
155  has_ces_part = true
156}
157
158if (dsoftbus_feature_lnn_wifi) {
159  defines += [ "ENABLE_FEATURE_LNN_WIFI" ]
160}
161
162if (dsoftbus_feature_lnn_ble) {
163  defines += [ "ENABLE_FEATURE_LNN_BLE" ]
164}
165
166if (dsoftbus_feature_deps_data_share && dsoftbus_feature_deps_datamgr_service) {
167  defines += [ "ENABLE_FEATURE_DATAMGR_SERVICE" ]
168}
169
170if (dsoftbus_feature_conn_pv1 && softbus_communication_wifi_feature &&
171    dsoftbus_feature_conn_tcp_comm) {
172  defines += [ "DSOFTBUS_FEATURE_CONN_PV1" ]
173  if (dsoftbus_feature_conn_pv2 && dsoftbus_feature_conn_pv1) {
174    defines += [ "DSOFTBUS_FEATURE_CONN_PV2" ]
175  }
176  if (dsoftbus_feature_conn_action) {
177    if (dsoftbus_feature_conn_hv2) {
178      defines += [ "DSOFTBUS_FEATURE_CONN_HV2" ]
179      if (dsoftbus_feature_conn_hv1 && dsoftbus_feature_conn_pv2 &&
180          dsoftbus_feature_conn_pv1) {
181        defines += [ "DSOFTBUS_FEATURE_CONN_HV1" ]
182      }
183    }
184  }
185}
186
187if (dsoftbus_feature_deps_sle) {
188  defines += [ "DSOFTBUS_FEATURE_SLE" ]
189}
190
191if (dsoftbus_feature_deps_remoteP2p_service) {
192  defines += [ "DSOFTBUS_DEVICE_CLOUD_CONVERGENCE" ]
193}
194