| # Copyright 2022 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. |
| |
| load( |
| "@rules_fuchsia//fuchsia:defs.bzl", |
| "fuchsia_cc_binary", |
| "fuchsia_cc_test", |
| "fuchsia_component", |
| "fuchsia_component_manifest", |
| "fuchsia_driver_bytecode_bind_rules", |
| "fuchsia_driver_component", |
| "fuchsia_driver_tool", |
| "fuchsia_fidl_library", |
| "fuchsia_fidl_llcpp_library", |
| "fuchsia_package", |
| "fuchsia_test_package", |
| "if_fuchsia", |
| ) |
| |
| # Driver component: qemu_edu |
| |
| fuchsia_fidl_library( |
| name = "fuchsia.hardware.qemuedu", |
| srcs = [ |
| "qemu_edu.fidl", |
| ], |
| library = "fuchsia.hardware.qemuedu", |
| visibility = ["//visibility:public"], |
| ) |
| |
| fuchsia_fidl_llcpp_library( |
| name = "fuchsia.hardware.qemuedu_cc", |
| library = ":fuchsia.hardware.qemuedu", |
| visibility = ["//visibility:public"], |
| deps = [ |
| "@fuchsia_sdk//fidl/zx:zx_llcpp_cc", |
| "@fuchsia_sdk//pkg/fidl_cpp_wire", |
| ], |
| ) |
| |
| fuchsia_driver_bytecode_bind_rules( |
| name = "bind_bytecode", |
| output = "qemu_edu.bindbc", |
| rules = "qemu_edu.bind", |
| deps = [ |
| "@fuchsia_sdk//bind/fuchsia.pci", |
| ], |
| ) |
| |
| cc_binary( |
| name = "qemu_edu", |
| srcs = [ |
| "qemu_edu.cc", |
| "qemu_edu.h", |
| "registers.h", |
| ], |
| linkshared = True, |
| deps = [ |
| ":fuchsia.hardware.qemuedu_cc", |
| "@fuchsia_sdk//fidl/fuchsia.device.fs:fuchsia.device.fs_llcpp_cc", |
| "@fuchsia_sdk//fidl/fuchsia.driver.compat:fuchsia.driver.compat_llcpp_cc", |
| "@fuchsia_sdk//fidl/fuchsia.hardware.pci:fuchsia.hardware.pci_llcpp_cc", |
| "@fuchsia_sdk//fidl/zx:zx_cc", |
| "@fuchsia_sdk//pkg/driver2-llcpp", |
| "@fuchsia_sdk//pkg/driver_runtime_cpp", |
| "@fuchsia_sdk//pkg/fidl_cpp_wire", |
| "@fuchsia_sdk//pkg/hwreg", |
| "@fuchsia_sdk//pkg/mmio", |
| "@fuchsia_sdk//pkg/sys_component_llcpp", |
| "@fuchsia_sdk//pkg/zx", |
| ], |
| ) |
| |
| fuchsia_component_manifest( |
| name = "manifest", |
| src = "meta/qemu_edu.cml", |
| includes = [ |
| "@fuchsia_sdk//pkg/syslog:client", |
| ], |
| ) |
| |
| fuchsia_driver_component( |
| name = "component", |
| bind_bytecode = ":bind_bytecode", |
| driver_lib = ":qemu_edu", |
| manifest = ":manifest", |
| ) |
| |
| fuchsia_package( |
| name = "pkg", |
| package_name = "qemu_edu", |
| visibility = ["//visibility:public"], |
| deps = [ |
| ":component", |
| ], |
| ) |
| |
| # Tools component: eductl |
| |
| fuchsia_cc_binary( |
| name = "eductl", |
| srcs = [ |
| "eductl.cc", |
| ], |
| deps = [ |
| ":fuchsia.hardware.qemuedu_cc", |
| "@fuchsia_sdk//pkg/fdio", |
| "@fuchsia_sdk//pkg/fidl_cpp_wire", |
| ], |
| ) |
| |
| fuchsia_component_manifest( |
| name = "eductl_manifest", |
| src = "meta/eductl.cml", |
| includes = [ |
| "@fuchsia_sdk//pkg/syslog:client", |
| ], |
| ) |
| |
| fuchsia_component( |
| name = "eductl_component", |
| manifest = ":eductl_manifest", |
| deps = [ |
| ":eductl", |
| ], |
| ) |
| |
| fuchsia_driver_tool( |
| name = "eductl_tool", |
| binary = ":eductl", |
| ) |
| |
| fuchsia_package( |
| name = "eductl_pkg", |
| package_name = "eductl", |
| visibility = ["//visibility:public"], |
| deps = [ |
| ":eductl_component", |
| ":eductl_tool", |
| ], |
| ) |
| |
| # System test component: edu_system_test |
| |
| fuchsia_cc_test( |
| name = "qemu_edu_system_test", |
| size = "small", |
| srcs = [ |
| "qemu_edu_system_test.cc", |
| ], |
| deps = ["@com_google_googletest//:gtest_main"] + if_fuchsia([ |
| ":fuchsia.hardware.qemuedu_cc", |
| "@fuchsia_sdk//pkg/fdio", |
| ]), |
| ) |
| |
| fuchsia_component_manifest( |
| name = "system_test_manifest", |
| src = "meta/qemu_edu_system_test.cml", |
| includes = [ |
| "@fuchsia_sdk//pkg/sys/testing:elf_test_runner", |
| "@fuchsia_sdk//pkg/syslog:client", |
| ], |
| ) |
| |
| fuchsia_component( |
| name = "system_test_component", |
| testonly = True, |
| manifest = "system_test_manifest", |
| deps = [ |
| ":qemu_edu_system_test", |
| ], |
| ) |
| |
| fuchsia_test_package( |
| name = "test_pkg", |
| package_name = "qemu_edu_system_test", |
| visibility = ["//visibility:public"], |
| deps = [ |
| ":system_test_component", |
| ], |
| ) |