| # Copyright 2023 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_pw_build/target_types.gni") |
| import("$dir_pw_unit_test/test.gni") |
| |
| dir_public_gatt = "../../public/pw_bluetooth_sapphire/internal/host/gatt" |
| |
| # Basic target with protocol definitions and no logic, suitable for test |
| # emulation. |
| pw_source_set("definitions") { |
| public = [ "$dir_public_gatt/gatt_defs.h" ] |
| |
| sources = [ "gatt_defs.cc" ] |
| |
| public_deps = [ "$dir_pw_bluetooth_sapphire/host/att:definitions" ] |
| } |
| |
| pw_source_set("gatt") { |
| public = [ |
| "$dir_public_gatt/client.h", |
| "$dir_public_gatt/connection.h", |
| "$dir_public_gatt/gatt.h", |
| "$dir_public_gatt/generic_attribute_service.h", |
| "$dir_public_gatt/local_service_manager.h", |
| "$dir_public_gatt/remote_characteristic.h", |
| "$dir_public_gatt/remote_service.h", |
| "$dir_public_gatt/remote_service_manager.h", |
| "$dir_public_gatt/server.h", |
| "$dir_public_gatt/types.h", |
| ] |
| |
| sources = [ |
| "client.cc", |
| "connection.cc", |
| "gatt.cc", |
| "generic_attribute_service.cc", |
| "local_service_manager.cc", |
| "remote_characteristic.cc", |
| "remote_service.cc", |
| "remote_service_manager.cc", |
| "server.cc", |
| "types.cc", |
| ] |
| |
| public_deps = [ |
| ":definitions", |
| "$dir_pw_bluetooth_sapphire:config", |
| "$dir_pw_bluetooth_sapphire/host/att", |
| "$dir_pw_third_party/fuchsia:fit", |
| ] |
| } |
| |
| pw_source_set("testing") { |
| testonly = pw_unit_test_TESTONLY |
| |
| public = [ |
| "$dir_public_gatt/fake_client.h", |
| "$dir_public_gatt/fake_layer.h", |
| "$dir_public_gatt/mock_server.h", |
| ] |
| |
| sources = [ |
| "fake_client.cc", |
| "fake_layer.cc", |
| "mock_server.cc", |
| ] |
| |
| public_deps = [ |
| ":gatt", |
| "$dir_pw_async:heap_dispatcher", |
| "$dir_pw_bluetooth_sapphire/host/common", |
| "$dir_pw_unit_test", |
| ] |
| } |
| |
| pw_test("tests") { |
| sources = [ |
| "client_test.cc", |
| "gatt_test.cc", |
| "generic_attribute_service_test.cc", |
| "local_service_manager_test.cc", |
| "remote_service_manager_test.cc", |
| "server_test.cc", |
| ] |
| |
| deps = [ |
| ":gatt", |
| ":testing", |
| "$dir_pw_bluetooth_sapphire/host/att", |
| "$dir_pw_bluetooth_sapphire/host/l2cap:testing", |
| "$dir_pw_bluetooth_sapphire/host/testing", |
| ] |
| |
| test_main = "$dir_pw_bluetooth_sapphire/host/testing:gtest_main" |
| } |