| # 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" |
| tests = "tests.json" |
| deps = [ "//src/devices/bind/fuchsia.acpi" ] |
| } |
| |
| common_deps = [ |
| ":goldfish-bind", |
| "//sdk/fidl/fuchsia.hardware.goldfish:fuchsia.hardware.goldfish_cpp", |
| "//sdk/fidl/fuchsia.hardware.goldfish.pipe:fuchsia.hardware.goldfish.pipe_cpp", |
| "//sdk/fidl/fuchsia.hardware.sysmem:fuchsia.hardware.sysmem_cpp", |
| "//sdk/lib/component/outgoing/cpp", |
| "//sdk/lib/driver/runtime:driver_runtime_cpp", |
| "//src/devices/lib/acpi", |
| "//src/devices/lib/driver", |
| "//src/devices/lib/driver:driver_runtime", |
| "//src/devices/lib/goldfish/pipe_headers", |
| "//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/trace", |
| "//zircon/system/ulib/trace", |
| "//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(https://fxbug.dev/42136089): 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" |
| manifest = "meta/goldfish.cml" |
| } |
| |
| 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/banjo/fuchsia.hardware.sysmem:fuchsia.hardware.sysmem_banjo_cpp_mock", |
| "//sdk/fidl/fuchsia.hardware.goldfish:fuchsia.hardware.goldfish_cpp_testing", |
| "//sdk/fidl/fuchsia.hardware.goldfish.pipe:fuchsia.hardware.goldfish.pipe_cpp_testing", |
| "//sdk/fidl/fuchsia.hardware.sysmem:fuchsia.hardware.sysmem_cpp_testing", |
| "//sdk/fidl/fuchsia.sysmem:fuchsia.sysmem_cpp", |
| "//sdk/lib/async_patterns/testing/cpp", |
| "//sdk/lib/component/outgoing/cpp", |
| "//src/devices/lib/acpi/mock:mock-acpi", |
| "//src/devices/testing/fake-bti", |
| "//src/devices/testing/mock-ddk", |
| "//zircon/system/ulib/async-default", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/mmio-ptr:mmio-ptr-fake", |
| "//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" ] |
| test_specs = { |
| log_settings = { |
| max_severity = "ERROR" |
| } |
| } |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":goldfish-bind_test" ] |
| |
| if (target_cpu == "x64") { |
| deps += [ ":goldfish-pipe-device-test-package" ] |
| } |
| } |