| # Copyright 2019 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/dist/renamed_binary.gni") |
| import("//build/drivers.gni") |
| |
| driver_bind_rules("sysdev-bind") { |
| header_output = "sysdev-bind.h" |
| disable_autobind = true |
| } |
| |
| # TODO(https://fxbug.dev/77388): enable tests to select only 1 of the 3 |
| # root device drivers (test, misc, and sys). |
| # |
| # This is a workaround to include the sysdev test driver as the sys root |
| # device driver. It would be better to do this by specifying the |
| # `--sys-device-driver` flag to `driver-manager-test`, but this is |
| # currently not possible to do at build time with the v2 isolated_devmgr |
| # template. With this flag unspecified, `driver-manager-test` falls back to |
| # looking for driver/platform-bus.so, so we rename this sys driver to that. |
| renamed_binary("renamed_sys_binary") { |
| source = "$root_out_dir/sysdev.so" |
| source_deps = [ ":sysdev" ] |
| dest = "driver/platform-bus.so" |
| } |
| |
| fuchsia_driver("sysdev-driver") { |
| output_name = "sysdev" |
| sources = [ "sysdev.cc" ] |
| deps = [ |
| ":sysdev-bind", |
| "//sdk/fidl/fuchsia.boot:fuchsia.boot_c", |
| "//sdk/lib/fdio", |
| "//src/devices/lib/driver", |
| "//src/lib/ddk", |
| "//src/lib/ddktl", |
| "//zircon/system/ulib/fbl", |
| "//zircon/system/ulib/zx", |
| ] |
| |
| # TODO(fxbug.dev/95833): This target uses the deprecated C bindings. |
| # Consider switching to the C++ bindings. See linked bug for details. |
| configs += [ "//build/c:fidl-deprecated-c-bindings" ] |
| } |
| |
| fuchsia_driver_component("sysdev") { |
| component_name = "sysdev" |
| deps = [ ":sysdev-driver" ] |
| info = "sysdev-info.json" |
| colocate = true |
| } |