| # Copyright (c) 2020 Project CHIP Authors |
| # |
| # 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("//build_overrides/chip.gni") |
| |
| import("ble.gni") |
| |
| declare_args() { |
| # Extra header to include in BleConfig.h for project. |
| ble_project_config_include = "" |
| |
| # Extra header to include in BleConfig.h for platform. |
| ble_platform_config_include = "" |
| } |
| |
| config("ble_config") { |
| configs = [ "${chip_root}/src:includes" ] |
| |
| defines = [] |
| if (ble_project_config_include != "") { |
| defines += [ "BLE_PROJECT_CONFIG_INCLUDE=${ble_project_config_include}" ] |
| } |
| if (ble_platform_config_include != "") { |
| defines += [ "BLE_PLATFORM_CONFIG_INCLUDE=${ble_platform_config_include}" ] |
| } |
| |
| if (config_network_layer_ble) { |
| defines += [ "CONFIG_NETWORK_LAYER_BLE=1" ] |
| } else { |
| defines += [ "CONFIG_NETWORK_LAYER_BLE=0" ] |
| } |
| } |
| |
| source_set("ble_config_header") { |
| sources = [ "BleConfig.h" ] |
| |
| public_configs = [ ":ble_config" ] |
| |
| public_deps = [ "${chip_root}/src/system:system_config_header" ] |
| } |
| |
| if (config_network_layer_ble) { |
| static_library("ble") { |
| output_name = "libBleLayer" |
| |
| sources = [ |
| "BLEEndPoint.cpp", |
| "BLEEndPoint.h", |
| "Ble.h", |
| "BleApplicationDelegate.h", |
| "BleConfig.h", |
| "BleError.cpp", |
| "BleError.h", |
| "BleLayer.cpp", |
| "BleLayer.h", |
| "BlePlatformDelegate.h", |
| "BleUUID.cpp", |
| "BleUUID.h", |
| "BtpEngine.cpp", |
| "BtpEngine.h", |
| "CHIPBleServiceData.h", |
| ] |
| |
| public_deps = [ |
| ":ble_config_header", |
| "${chip_root}/src/inet", |
| "${chip_root}/src/lib/support", |
| ] |
| } |
| } else { |
| group("ble") { |
| } |
| } |