| # |
| # Copyright 2015 Google |
| # |
| # 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. |
| # |
| |
| config("service_config") { |
| include_dirs = [ |
| "//bt/system/", |
| "//bt/system/linux_include", |
| "//bt/system/include", |
| "//bt/system/service", |
| "//bt/system/service/common", |
| ] |
| |
| configs = [ "//bt/system:target_defaults" ] |
| } |
| |
| source_set("service_daemon_src") { |
| sources = [ |
| "a2dp_sink.cc", |
| "a2dp_source.cc", |
| "adapter.cc", |
| "avrcp_control.cc", |
| "avrcp_target.cc", |
| "daemon.cc", |
| "gatt_client.cc", |
| "gatt_server.cc", |
| "gatt_server_old.cc", |
| "hal/bluetooth_av_interface.cc", |
| "hal/bluetooth_avrcp_interface.cc", |
| "hal/bluetooth_gatt_interface.cc", |
| "hal/bluetooth_interface.cc", |
| "ipc/ipc_handler.cc", |
| "ipc/ipc_manager.cc", |
| "logging_helpers.cc", |
| "low_energy_advertiser.cc", |
| "low_energy_client.cc", |
| "low_energy_scanner.cc", |
| "settings.cc", |
| ] |
| |
| deps = [ |
| "//bt/system/gd/rust/shim:init_flags_bridge_header", |
| "//bt/system/osi", |
| "//bt/system/types", |
| ] |
| |
| configs += [ ":service_config" ] |
| } |
| |
| source_set("service_linux_src") { |
| sources = [ |
| "ipc/ipc_handler_linux.cc", |
| "ipc/linux_ipc_host.cc", |
| "ipc/dbus/ipc_handler_dbus.cc", |
| "ipc/dbus/bluetooth_adapter.cc", |
| ] |
| |
| deps = [ |
| "//bt/system/gd/rust/shim:init_flags_bridge_header", |
| "//bt/system/osi", |
| "//bt/system/types", |
| ] |
| |
| configs += [ ":service_config" ] |
| } |
| |
| static_library("service") { |
| sources = [ |
| "common/bluetooth/a2dp_codec_config.cc", |
| "common/bluetooth/adapter_state.cc", |
| "common/bluetooth/advertise_data.cc", |
| "common/bluetooth/advertise_settings.cc", |
| "common/bluetooth/avrcp_int_value.cc", |
| "common/bluetooth/avrcp_media_attr.cc", |
| "common/bluetooth/avrcp_register_notification_response.cc", |
| "common/bluetooth/characteristic.cc", |
| "common/bluetooth/descriptor.cc", |
| "common/bluetooth/remote_device_props.cc", |
| "common/bluetooth/scan_filter.cc", |
| "common/bluetooth/scan_result.cc", |
| "common/bluetooth/scan_settings.cc", |
| "common/bluetooth/service.cc", |
| "common/bluetooth/util/atomic_string.cc", |
| ] |
| |
| deps = [ |
| ":service_daemon_src", |
| ":service_linux_src", |
| "//bt/system/gd/rust/shim:init_flags_bridge_header", |
| "//bt/system/osi", |
| "//bt/system/types", |
| ] |
| |
| configs += [ ":service_config" ] |
| } |
| |
| executable("bluetoothtbd") { |
| sources = [ "main.cc" ] |
| |
| deps = [ |
| ":service", |
| "//bt/system/btcore", |
| "//bt/system/main:bluetooth", |
| ] |
| |
| configs += [ ":service_config" ] |
| |
| libs = [ |
| "dl", |
| "pthread", |
| "rt", |
| "bt_shim_ffi", |
| "ssl", |
| "crypto", |
| ] |
| |
| lib_dirs = [ |
| "${root_out_dir}/rust" |
| ] |
| } |
| |
| if (use.test) { |
| source_set("service_base_test_src") { |
| sources = [ |
| "hal/fake_bluetooth_av_interface.cc", |
| "hal/fake_bluetooth_gatt_interface.cc", |
| "hal/fake_bluetooth_interface.cc", |
| "test/a2dp_sink_unittest.cc", |
| "test/a2dp_source_unittest.cc", |
| "test/adapter_unittest.cc", |
| "test/advertise_data_unittest.cc", |
| "test/fake_hal_util.cc", |
| "test/gatt_client_unittest.cc", |
| "test/gatt_server_unittest.cc", |
| "test/low_energy_advertiser_unittest.cc", |
| "test/low_energy_client_unittest.cc", |
| "test/low_energy_scanner_unittest.cc", |
| "test/settings_unittest.cc", |
| ] |
| |
| configs += [ ":service_config" ] |
| } |
| |
| executable("bluetoothtbd_test") { |
| sources = [ "test/main.cc" ] |
| |
| deps = [ |
| ":service_base_test_src", |
| ":service_daemon_src", |
| ":service_linux_src", |
| "//bt/system/service/common:libbluetooth_common", |
| ] |
| |
| configs += [ |
| "//bt/system:external_gmock_main", |
| ":service_config", |
| ] |
| } |
| } |