| # Copyright 2023 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/python/python_binary.gni") |
| import("//build/python/python_c_extension.gni") |
| import("//build/rust/rustc_staticlib.gni") |
| |
| assert(is_host) |
| |
| rustc_staticlib("lib") { |
| output_name = "fuchsia_controller" |
| edition = "2021" |
| with_unit_tests = true |
| |
| deps = [ |
| "//src/connectivity/overnet/lib/hoist", |
| "//src/developer/ffx/config:lib", |
| "//src/developer/ffx/core:lib", |
| "//src/developer/ffx/daemon/proxy:lib", |
| "//src/developer/ffx/lib/errors:lib", |
| "//src/developer/ffx/lib/rcs:lib", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-async", |
| "//src/lib/versioning/version-history/rust:version-history", |
| "//src/lib/zircon/rust:fuchsia-zircon-status", |
| "//src/lib/zircon/rust:fuchsia-zircon-types", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:async-channel", |
| "//third_party/rust_crates:async-lock", |
| "//third_party/rust_crates:async-net", |
| "//third_party/rust_crates:byteorder", |
| "//third_party/rust_crates:futures-lite", |
| "//third_party/rust_crates:nix", |
| "//third_party/rust_crates:tempfile", |
| "//third_party/rust_crates:tracing", |
| ] |
| |
| sources = [ |
| "src/commands.rs", |
| "src/env_context.rs", |
| "src/ext_buffer.rs", |
| "src/lib.rs", |
| "src/lib_context.rs", |
| "src/waker.rs", |
| ] |
| } |
| |
| python_c_extension("fidl_codec") { |
| sources = [ |
| "abi/convert.h", |
| "abi/macros.h", |
| "fidl_codec/decode.cc", |
| "fidl_codec/decode.h", |
| "fidl_codec/encode.cc", |
| "fidl_codec/encode.h", |
| "fidl_codec/fidl_codec.cc", |
| "fidl_codec/ir.cc", |
| "fidl_codec/ir.h", |
| "fidl_codec/mod.cc", |
| "fidl_codec/mod.h", |
| "fidl_codec/object_converter.cc", |
| "fidl_codec/object_converter.h", |
| "fidl_codec/python_dict_visitor.h", |
| ] |
| |
| deps = [ |
| "//sdk/lib/fidl_base", |
| "//src/lib/fidl_codec", |
| "//third_party/rapidjson", |
| "//zircon/system/public", |
| ] |
| } |
| |
| python_c_extension("fuchsia_controller_py") { |
| sources = [ |
| "abi/convert.h", |
| "abi/error.cc", |
| "abi/error.h", |
| "abi/fidl_channel.cc", |
| "abi/fidl_channel.h", |
| "abi/fidl_handle.cc", |
| "abi/fidl_handle.h", |
| "abi/fuchsia_controller.h", |
| "abi/fuchsia_controller_py.cc", |
| "abi/macros.h", |
| "abi/mod.cc", |
| "abi/mod.h", |
| ] |
| |
| deps = [ |
| ":lib", |
| "//zircon/system/public", |
| ] |
| } |
| |
| python_binary("example") { |
| main_source = "python/example.py" |
| deps = [ |
| ":fidl_codec", |
| ":fuchsia_controller_py", |
| "//src/developer/ffx:ffx_tool", |
| ] |
| } |
| |
| group("fuchsia-controller") { |
| testonly = true |
| deps = [ |
| ":example", |
| ":fidl_codec", |
| ":fuchsia_controller_py", |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":lib_test", |
| "tests:fuchsia_controller_encode_test", |
| "tests:fuchsia_controller_ir_test", |
| ] |
| |
| # TODO(fxbug.dev/127523): This test fails on mac builders. This is most likely because of the |
| # infra machines running OSX 10.15 |
| if (host_os != "mac") { |
| deps += [ "tests:fuchsia_controller_errors_test" ] |
| } |
| } |