# Copyright (c) 2021 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import("../../../adapter/common/net/bluetooth/net_bluetooth.gni") import("../../../dsoftbus.gni") native_source_path = rebase_path("$dsoftbus_root_path") conn_ble_dir = "dsoftbus_enhance/core/connection/ble_direct" enhanced_conn_ble = exec_script("$dsoftbus_root_path/check_sub_module.py", [ "$native_source_path", "$conn_ble_dir", ], "value") conn_coc_dir = "dsoftbus_enhance/core/connection/coc" enhanced_conn_coc = exec_script("$dsoftbus_root_path/check_sub_module.py", [ "$native_source_path", "$conn_coc_dir", ], "value") ble_connection_external_deps = [] if (!support_bluetooth) { ble_connection_src = [ "$dsoftbus_root_path/core/connection/ble/src/softbus_conn_ble_direct_virtual.c", "$dsoftbus_root_path/core/connection/ble/src/softbus_conn_ble_virtual.c", "$dsoftbus_root_path/adapter/common/net/bluetooth/common/softbus_adapter_bt_common_virtual.c", ] ble_connection_inc = [ "$dsoftbus_root_path/adapter/common/net/bluetooth/include", "$dsoftbus_root_path/core/connection/ble/include", "$dsoftbus_root_path/core/common/include", ] } else { if (!dsoftbus_feature_conn_ble) { ble_connection_src = [ "$dsoftbus_root_path/core/connection/ble/src/softbus_conn_ble_direct_virtual.c", "$dsoftbus_root_path/core/connection/ble/src/softbus_conn_ble_virtual.c", "$dsoftbus_root_path/adapter/common/net/bluetooth/common/softbus_adapter_bt_common_virtual.c", ] ble_connection_inc = [ "$dsoftbus_root_path/adapter/common/net/bluetooth/include", "$dsoftbus_root_path/core/connection/ble/include", "$dsoftbus_root_path/core/common/include", ] if (dsoftbus_feature_conn_br) { ble_connection_src += adapter_net_br_src ble_connection_inc += adapter_ble_inc ble_connection_external_deps += adapter_ble_external_deps } } else { ble_connection_src = [ "$dsoftbus_root_path/core/connection/ble/src/softbus_conn_ble_client.c", "$dsoftbus_root_path/core/connection/ble/src/softbus_conn_ble_connection.c", "$dsoftbus_root_path/core/connection/ble/src/softbus_conn_ble_manager.c", "$dsoftbus_root_path/core/connection/ble/src/softbus_conn_ble_send_queue.c", "$dsoftbus_root_path/core/connection/ble/src/softbus_conn_ble_server.c", "$dsoftbus_root_path/core/connection/ble/src/softbus_conn_ble_trans.c", ] ble_connection_inc = [ "$dsoftbus_root_path/core/connection/ble/include", "$dsoftbus_root_path/core/connection/ble/src", "$dsoftbus_root_path/core/common/include", ] if (enhanced_conn_ble == true) { import( "../../../dsoftbus_enhance/core/connection/ble_direct/ble_direct.gni") ble_connection_src += ble_direct_connection_src ble_connection_inc += ble_direct_connection_inc } else { ble_connection_src += [ "$dsoftbus_root_path/core/connection/ble/src/softbus_conn_ble_direct_virtual.c" ] } if (enhanced_conn_coc == true) { ble_connection_src += [ "$dsoftbus_root_path/dsoftbus_enhance/core/connection/coc/src/ble_protocol_interface_factory.c", "$dsoftbus_root_path/dsoftbus_enhance/core/connection/coc/src/softbus_adapter_coc.c", "$dsoftbus_root_path/dsoftbus_enhance/core/connection/coc/src/softbus_conn_ble_coc.c", ] ble_connection_inc += [ "$dsoftbus_root_path/dsoftbus_enhance/core/connection/coc/include" ] } else { ble_connection_src += [ "$dsoftbus_root_path/core/connection/ble/src/ble_protocol_interface_factory.c" ] } ble_connection_src += adapter_ble_src ble_connection_inc += adapter_ble_inc ble_connection_external_deps += adapter_ble_external_deps } }