| # Copyright 2024 The Pigweed 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 |
| # |
| # https://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. |
| |
| load("@rules_cc//cc:cc_library.bzl", "cc_library") |
| load("@rules_python//sphinxdocs:sphinx_docs_library.bzl", "sphinx_docs_library") |
| load("//pw_bloat:pw_size_diff.bzl", "pw_size_diff") |
| load("//pw_bloat:pw_size_table.bzl", "pw_size_table") |
| load("//pw_bluetooth_proxy:bt-proxy.bzl", "pw_bluetooth_proxy_library", "pw_bluetooth_proxy_test", "pw_bluetooth_proxy_test_utils") |
| load("//pw_build:compatibility.bzl", "incompatible_with_mcu") |
| |
| package( |
| default_visibility = ["//visibility:public"], |
| features = [ |
| "-layering_check", |
| "-ctad_warnings", |
| ], |
| ) |
| |
| licenses(["notice"]) |
| |
| # Module configuration |
| |
| cc_library( |
| name = "config", |
| hdrs = ["public/pw_bluetooth_proxy/config.h"], |
| strip_include_prefix = "public", |
| deps = [":config_override"], |
| ) |
| |
| label_flag( |
| name = "config_override", |
| build_setting_default = "//pw_build:default_module_config", |
| ) |
| |
| label_flag( |
| name = "clock_backend", |
| build_setting_default = ":system_clock_backend", |
| ) |
| |
| cc_library( |
| name = "system_clock_backend", |
| hdrs = ["public_overrides/system_clock_backend/pw_bluetooth_proxy_backend/clock.h"], |
| strip_include_prefix = "public_overrides/system_clock_backend", |
| deps = [ |
| "//pw_async2:system_time_provider", |
| "//pw_chrono:system_clock", |
| ], |
| ) |
| |
| # Libraries |
| |
| # LINT.IfChange |
| |
| cc_library( |
| name = "clock", |
| hdrs = ["public/pw_bluetooth_proxy/clock.h"], |
| strip_include_prefix = "public", |
| visibility = ["//pw_bluetooth_proxy:__subpackages__"], |
| deps = [ |
| ":clock_backend", |
| ":config", |
| ], |
| ) |
| |
| pw_bluetooth_proxy_library( |
| name = "pw_bluetooth_proxy", |
| ) |
| |
| pw_bluetooth_proxy_library( |
| name = "pw_bluetooth_proxy_sync", |
| testonly = True, |
| defines = ["PW_BLUETOOTH_PROXY_ASYNC=0"], |
| visibility = ["//pw_bluetooth_proxy:__subpackages__"], |
| ) |
| |
| pw_bluetooth_proxy_library( |
| name = "pw_bluetooth_proxy_async", |
| testonly = True, |
| defines = ["PW_BLUETOOTH_PROXY_ASYNC=1"], |
| visibility = ["//pw_bluetooth_proxy:__subpackages__"], |
| ) |
| |
| alias( |
| name = "gatt", |
| actual = "//pw_bluetooth_proxy/gatt", |
| ) |
| |
| alias( |
| name = "rfcomm", |
| actual = "//pw_bluetooth_proxy/rfcomm", |
| ) |
| |
| # Tests |
| |
| pw_bluetooth_proxy_test_utils( |
| name = "test_utils_sync", |
| defines = ["PW_BLUETOOTH_PROXY_ASYNC=0"], |
| versioned_deps = [":pw_bluetooth_proxy_sync"], |
| visibility = ["//pw_bluetooth_proxy:__subpackages__"], |
| ) |
| |
| pw_bluetooth_proxy_test_utils( |
| name = "test_utils_async", |
| defines = ["PW_BLUETOOTH_PROXY_ASYNC=1"], |
| versioned_deps = [":pw_bluetooth_proxy_async"], |
| visibility = ["//pw_bluetooth_proxy:__subpackages__"], |
| ) |
| |
| pw_bluetooth_proxy_test( |
| name = "pw_bluetooth_proxy_sync_test", |
| defines = ["PW_BLUETOOTH_PROXY_ASYNC=0"], |
| versioned_deps = [ |
| ":pw_bluetooth_proxy_sync", |
| ":test_utils_sync", |
| ], |
| ) |
| |
| pw_bluetooth_proxy_test( |
| name = "pw_bluetooth_proxy_async_test", |
| defines = ["PW_BLUETOOTH_PROXY_ASYNC=1"], |
| versioned_deps = [ |
| ":pw_bluetooth_proxy_async", |
| ":test_utils_async", |
| ], |
| ) |
| |
| # LINT.ThenChange(BUILD.gn, CMakeLists.txt) |
| |
| filegroup( |
| name = "doxygen", |
| srcs = [ |
| "public/pw_bluetooth_proxy/config.h", |
| "public/pw_bluetooth_proxy/h4_packet.h", |
| "public/pw_bluetooth_proxy/proxy_host.h", |
| ], |
| ) |
| |
| pw_size_diff( |
| name = "use_passthrough_proxy_size_diff", |
| base = "//pw_bloat:bloat_base", |
| label = "Create and use proxy as a simple passthrough", |
| target = "//pw_bluetooth_proxy/size_report:use_passthrough_proxy", |
| ) |
| |
| pw_size_table( |
| name = "use_passthrough_proxy_size_report", |
| reports = [ |
| ":use_passthrough_proxy_size_diff", |
| ], |
| ) |
| |
| sphinx_docs_library( |
| name = "docs", |
| srcs = [ |
| "docs.rst", |
| "proxy_host_test.cc", |
| ":use_passthrough_proxy_size_report", |
| ], |
| prefix = "pw_bluetooth_proxy/", |
| target_compatible_with = incompatible_with_mcu(), |
| ) |