| # Copyright 2018 The Fuchsia Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| import("//build/bind/bind.gni") |
| import("//build/components.gni") |
| import("//build/config/fuchsia/rules.gni") |
| import("//build/test.gni") |
| |
| wlanphy_sources = [ |
| "device.cc", |
| "device.h", |
| "driver.cc", |
| "driver.h", |
| ] |
| |
| wlanphy_deps = [ |
| ":wlanphy_bind", |
| "//garnet/lib/wlan/protocol", |
| "//sdk/banjo/ddk.hw.wlan.wlaninfo", |
| "//sdk/banjo/fuchsia.hardware.wlanphyimpl:fuchsia.hardware.wlanphyimpl_banjo_cpp", |
| "//sdk/fidl/fuchsia.wlan.device", |
| "//sdk/fidl/fuchsia.wlan.device:fuchsia.wlan.device_llcpp", |
| "//src/connectivity/wlan/lib/common/cpp:common", |
| "//src/devices/lib/driver", |
| "//src/lib/ddk", |
| "//zircon/public/lib/async-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| ] |
| |
| bind_rules("wlanphy_bind") { |
| rules = "wlanphy.bind" |
| output = "wlanphy-bind.h" |
| tests = "wlanphy_bind_test.json" |
| deps = [ "//src/devices/bind/fuchsia.wlan" ] |
| } |
| |
| driver_module("wlanphy_driver") { |
| output_name = "wlanphy" |
| sources = wlanphy_sources |
| |
| deps = wlanphy_deps |
| configs += [ "//build/config/fuchsia:enable_zircon_asserts" ] |
| |
| # TODO(fxbug.dev/69585): This target uses raw zx::channel with LLCPP which is deprecated. |
| # Please migrate to typed channel APIs (fidl::ClientEnd<T>, fidl::ServerEnd<T>). |
| # See linked bug for details. |
| configs += [ "//build/cpp:fidl-llcpp-deprecated-raw-channels" ] |
| } |
| |
| fuchsia_system_package("wlanphy") { |
| deps = [ ":wlanphy_driver" ] |
| allowed_in_extra_deps = true |
| } |
| |
| # unit tests start here |
| |
| test("wlanphy_convert_unittest") { |
| sources = wlanphy_sources + [ "tests/convert_unittest.cc" ] |
| |
| deps = wlanphy_deps + [ "//src/lib/fxl/test:gtest_main" ] |
| |
| configs += |
| [ "//src/connectivity/wlan/lib/mlme/cpp/tests:wlan_mlme_tests_config" ] |
| |
| # TODO(fxbug.dev/69585): This target uses raw zx::channel with LLCPP which is deprecated. |
| # Please migrate to typed channel APIs (fidl::ClientEnd<T>, fidl::ServerEnd<T>). |
| # See linked bug for details. |
| configs += [ "//build/cpp:fidl-llcpp-deprecated-raw-channels" ] |
| } |
| |
| fuchsia_unittest_package("wlanphy-unittests") { |
| deps = [ ":wlanphy_convert_unittest" ] |
| manifest = "meta/wlanphy_convert_unittest.cmx" |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":wlanphy-unittests", |
| ":wlanphy_bind_test", |
| ] |
| } |