| # 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/components.gni") | |
| import("//build/drivers.gni") | |
| import("//build/test.gni") | |
| driver_bind_rules("goldfish-bind") { | |
| rules = "goldfish.bind" | |
| header_output = "goldfish-bind.h" | |
| tests = "tests.json" | |
| deps = [ "//src/devices/bind/fuchsia.acpi" ] | |
| } | |
| common_deps = [ | |
| ":goldfish-bind", | |
| "//sdk/banjo/fuchsia.hardware.goldfish.pipe:fuchsia.hardware.goldfish.pipe_banjo_cpp", | |
| "//sdk/banjo/fuchsia.hardware.sysmem:fuchsia.hardware.sysmem_banjo_cpp", | |
| "//sdk/fidl/fuchsia.hardware.goldfish:fuchsia.hardware.goldfish_llcpp", | |
| "//src/devices/lib/acpi", | |
| "//src/devices/lib/driver", | |
| "//src/devices/lib/mmio", | |
| "//src/lib/ddk", | |
| "//src/lib/ddktl", | |
| "//zircon/system/ulib/async-loop:async-loop-cpp", | |
| "//zircon/system/ulib/async-loop:async-loop-default", | |
| "//zircon/system/ulib/fbl", | |
| "//zircon/system/ulib/fidl:fidl-llcpp", | |
| "//zircon/system/ulib/trace", | |
| "//zircon/system/ulib/trace:trace-driver", | |
| "//zircon/system/ulib/zircon-internal", | |
| "//zircon/system/ulib/zx", | |
| ] | |
| fuchsia_driver("goldfish_driver-driver") { | |
| output_name = "goldfish" | |
| sources = [ | |
| "instance.cc", | |
| "instance.h", | |
| "pipe.cc", | |
| "pipe.h", | |
| "pipe_device.cc", | |
| "pipe_device.h", | |
| ] | |
| deps = common_deps | |
| configs += [ "//build/config/fuchsia:enable_zircon_asserts" ] | |
| configs += [ "//build/config:all_source" ] | |
| # TODO(fxbug.dev/58162): delete the below and fix compiler warnings | |
| configs += [ "//build/config:Wno-conversion" ] | |
| } | |
| fuchsia_driver_component("goldfish_driver") { | |
| component_name = "goldfish" | |
| deps = [ ":goldfish_driver-driver" ] | |
| info = "goldfish_driver-info.json" | |
| colocate = true | |
| } | |
| fuchsia_driver_package("goldfish") { | |
| driver_components = [ ":goldfish_driver" ] | |
| } | |
| test("goldfish-pipe-device-test") { | |
| output_name = "goldfish-pipe-device-test" | |
| sources = [ | |
| "instance.cc", | |
| "instance_test.cc", | |
| "pipe.cc", | |
| "pipe_device.cc", | |
| "pipe_device_test.cc", | |
| ] | |
| deps = common_deps + [ | |
| "//sdk/fidl/fuchsia.sysmem:fuchsia.sysmem_llcpp", | |
| "//sdk/banjo/fuchsia.hardware.sysmem:fuchsia.hardware.sysmem_banjo_cpp_mock", | |
| "//sdk/banjo/fuchsia.hardware.goldfish.pipe:fuchsia.hardware.goldfish.pipe_banjo_cpp_mock", | |
| "//src/devices/testing/fake-bti", | |
| "//src/devices/testing/mock-ddk", | |
| "//src/devices/lib/acpi/mock:mock-acpi", | |
| "//zircon/system/ulib/async-loop:async-loop-cpp", | |
| "//zircon/system/ulib/mmio-ptr:mmio-ptr-fake", | |
| "//zircon/system/ulib/fidl-async:fidl-async-cpp", | |
| "//zircon/system/ulib/mock-function", | |
| "//zircon/system/ulib/sync", | |
| "//zircon/system/ulib/zircon-internal", | |
| "//zircon/system/ulib/zx", | |
| "//zircon/system/ulib/zxtest", | |
| ] | |
| configs += [ "//build/config:all_source" ] | |
| } | |
| fuchsia_unittest_package("goldfish-pipe-device-test-package") { | |
| package_name = "goldfish-pipe-device-test" | |
| deps = [ ":goldfish-pipe-device-test" ] | |
| } | |
| group("tests") { | |
| testonly = true | |
| deps = [ ":goldfish-bind_test" ] | |
| if (target_cpu == "x64") { | |
| deps += [ ":goldfish-pipe-device-test-package" ] | |
| } | |
| } |