| # Copyright 2020 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/components.gni") |
| import("//build/test.gni") |
| |
| executable("gpioutil") { |
| if (is_fuchsia) { |
| configs += [ "//build/unification/config:zircon-migrated" ] |
| } |
| sources = [ |
| "gpioutil.cc", |
| "main.cc", |
| ] |
| deps = [ |
| "//sdk/fidl/fuchsia.hardware.gpio:fuchsia.hardware.gpio_llcpp", |
| "//sdk/lib/fdio", |
| "//src/lib/ddk", |
| "//zircon/public/lib/fbl", |
| "//zircon/public/lib/zxc", |
| ] |
| |
| # 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" ] |
| } |
| |
| test("gpioutil-test-bin") { |
| configs += [ "//build/unification/config:zircon-migrated" ] |
| output_name = "gpioutil-test" |
| sources = [ |
| "gpioutil.cc", |
| "test/gpioutil-test.cc", |
| ] |
| include_dirs = [ "." ] |
| deps = [ |
| "//sdk/fidl/fuchsia.hardware.gpio:fuchsia.hardware.gpio_llcpp", |
| "//sdk/lib/fdio", |
| "//src/lib/ddk", |
| "//zircon/public/lib/fbl", |
| "//zircon/public/lib/mock-function", |
| "//zircon/public/lib/zxc", |
| "//zircon/public/lib/zxtest", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| "//zircon/system/ulib/fidl-async:fidl-async-cpp", |
| "//zircon/system/ulib/fidl-utils", |
| ] |
| |
| # 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("gpioutil-test") { |
| deps = [ ":gpioutil-test-bin" ] |
| test_specs = { |
| environments = basic_envs |
| } |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":gpioutil-test" ] |
| } |