| # 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. |
| |
| import("//build_overrides/pigweed.gni") |
| |
| import("$dir_pigweed/third_party/emboss/emboss.gni") |
| import("$dir_pw_bloat/bloat.gni") |
| import("$dir_pw_build/target_types.gni") |
| import("$dir_pw_chrono/backend.gni") |
| import("$dir_pw_docgen/docs.gni") |
| import("$dir_pw_unit_test/test.gni") |
| |
| config("public_include_path") { |
| include_dirs = [ "public" ] |
| visibility = [ ":*" ] |
| } |
| |
| pw_doc_group("docs") { |
| # Also, sources with doxygen comment blocks must be added to //docs/BUILD.gn |
| inputs = [ "proxy_host_test.cc" ] |
| sources = [ "docs.rst" ] |
| report_deps = [ ":use_passthrough_proxy_size_report" ] |
| } |
| |
| pw_test_group("tests") { |
| tests = [ |
| ":pw_bluetooth_proxy_test", |
| ":emboss_util_test", |
| ] |
| } |
| |
| pw_source_set("pw_bluetooth_proxy") { |
| public_configs = [ ":public_include_path" ] |
| public = [ |
| "public/pw_bluetooth_proxy/acl_data_channel.h", |
| "public/pw_bluetooth_proxy/common.h", |
| "public/pw_bluetooth_proxy/proxy_host.h", |
| ] |
| public_deps = [ |
| "//pw_bluetooth:emboss_hci_common", |
| "//pw_bluetooth:emboss_hci_events", |
| "//pw_bluetooth:emboss_hci_h4", |
| dir_pw_function, |
| dir_pw_log, |
| dir_pw_span, |
| ] |
| deps = [ dir_pw_log ] |
| sources = [ |
| "acl_data_channel.cc", |
| "emboss_util.h", |
| "proxy_host.cc", |
| ] |
| } |
| |
| pw_test("emboss_util_test") { |
| enable_if = |
| dir_pw_third_party_emboss != "" && pw_chrono_SYSTEM_CLOCK_BACKEND != "" |
| sources = [ |
| "emboss_util.h", |
| "emboss_util_test.cc", |
| ] |
| include_dirs = [ "." ] |
| deps = [ |
| ":pw_bluetooth_proxy", |
| "//pw_bluetooth:emboss_hci_test", |
| "//pw_span", |
| ] |
| } |
| |
| pw_test("pw_bluetooth_proxy_test") { |
| enable_if = |
| dir_pw_third_party_emboss != "" && pw_chrono_SYSTEM_CLOCK_BACKEND != "" |
| sources = [ |
| "emboss_util.h", |
| "proxy_host_test.cc", |
| ] |
| include_dirs = [ "." ] |
| deps = [ |
| ":pw_bluetooth_proxy", |
| "$dir_pw_third_party/fuchsia:stdcompat", |
| "//pw_bluetooth:emboss_hci_commands", |
| "//pw_bluetooth:emboss_hci_common", |
| "//pw_bluetooth:emboss_hci_events", |
| "//pw_bluetooth:emboss_hci_h4", |
| ] |
| } |
| |
| # We depend on emboss, so we can only compute size when emboss is in the build. |
| if (dir_pw_third_party_emboss != "") { |
| pw_size_diff("use_passthrough_proxy_size_report") { |
| title = "pw_bluetooth_proxy Passthrough Size Report" |
| base = "$dir_pw_bloat:bloat_base" |
| binaries = [ |
| { |
| target = "size_report:use_passthrough_proxy" |
| label = "Create and use proxy as a simple passthrough" |
| }, |
| ] |
| } |
| } else { |
| pw_size_diff("use_passthrough_proxy_size_report") { |
| title = "pw_bluetooth_proxy Passthrough Size Report" |
| base = "$dir_pw_bloat:bloat_base" |
| binaries = [ |
| { |
| target = "$dir_pw_bloat:bloat_base" |
| label = "Emboss not configured." |
| }, |
| ] |
| } |
| } |