| # 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_control_composite-bind") { |
| rules = "goldfish_control_composite.bind" |
| tests = "bind_tests.json" |
| deps = [ |
| "//sdk/fidl/fuchsia.hardware.goldfish:fuchsia.hardware.goldfish_bindlib", |
| "//sdk/fidl/fuchsia.hardware.goldfish.pipe:fuchsia.hardware.goldfish.pipe_bindlib", |
| "//sdk/fidl/fuchsia.hardware.sysmem:fuchsia.hardware.sysmem_bindlib", |
| "//src/devices/bind/fuchsia.google.platform", |
| ] |
| } |
| |
| common_deps = [ |
| ":goldfish_control_composite-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/fidl/fuchsia.sysmem2:fuchsia.sysmem2_cpp", |
| "//sdk/lib/component/outgoing/cpp", |
| "//sdk/lib/driver/runtime:driver_runtime_cpp", |
| "//sdk/lib/fit-promise", |
| "//src/devices/lib/driver", |
| "//src/devices/lib/driver:driver_runtime", |
| "//src/devices/lib/goldfish/pipe_headers", |
| "//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/sysmem-version", |
| "//zircon/system/ulib/trace", |
| "//zircon/system/ulib/trace", |
| "//zircon/system/ulib/zircon-internal", |
| "//zircon/system/ulib/zx", |
| ] |
| |
| fuchsia_driver("control_driver-driver") { |
| output_name = "goldfish_control" |
| |
| sources = [ |
| "control_device.cc", |
| "control_device.h", |
| "device_local_heap.cc", |
| "device_local_heap.h", |
| "heap.cc", |
| "heap.h", |
| "host_visible_heap.cc", |
| "host_visible_heap.h", |
| ] |
| |
| deps = common_deps |
| |
| configs += [ "//build/config/fuchsia:enable_zircon_asserts" ] |
| |
| configs += [ "//build/config:all_source" ] |
| |
| # TODO(https://fxbug.dev/42176699): This target uses mutable tables which are deprecated, |
| # rather than builders. |
| configs += [ "//build/cpp:fidl-wire-deprecated-mutable-tables" ] |
| } |
| |
| fuchsia_driver_component("control_driver") { |
| component_name = "goldfish_control" |
| deps = [ ":control_driver-driver" ] |
| info = "control_driver-info.json" |
| manifest = "meta/control_driver.cml" |
| } |
| |
| fuchsia_driver_package("goldfish_control") { |
| driver_components = [ ":control_driver" ] |
| } |
| |
| test("goldfish-control-device-test") { |
| output_name = "goldfish-control-device-test" |
| sources = [ |
| "control_device.cc", |
| "control_device.h", |
| "device_local_heap.cc", |
| "device_local_heap.h", |
| "heap.cc", |
| "heap.h", |
| "host_visible_heap.cc", |
| "host_visible_heap.h", |
| "tests/control_device_test.cc", |
| ] |
| deps = common_deps + [ |
| "//sdk/fidl/fuchsia.hardware.goldfish:fuchsia.hardware.goldfish_cpp_testing", |
| "//sdk/fidl/fuchsia.sysmem2:fuchsia.sysmem2_cpp", |
| "//sdk/lib/async-loop-testing/cpp", |
| "//sdk/lib/component/outgoing/cpp", |
| "//src/devices/testing/fake-bti", |
| "//src/devices/testing/fake-object", |
| "//src/devices/testing/mock-ddk", |
| "//src/lib/fsl", |
| "//src/lib/fxl/test:gtest_main", |
| "//third_party/googletest:gtest", |
| "//zircon/system/ulib/fzl", |
| "//zircon/system/ulib/mmio-ptr:mmio-ptr-fake", |
| "//zircon/system/ulib/sync", |
| "//zircon/system/ulib/sync:sync-cpp", |
| "//zircon/system/ulib/zircon-internal", |
| "//zircon/system/ulib/zx", |
| ] |
| |
| configs += [ "//build/config:all_source" ] |
| |
| # TODO(https://fxbug.dev/42176699): This target uses mutable tables which are deprecated, |
| # rather than builders. |
| configs += [ "//build/cpp:fidl-wire-deprecated-mutable-tables" ] |
| } |
| |
| fuchsia_unittest_package("goldfish-control-device-test-package") { |
| package_name = "goldfish-control-device-test" |
| deps = [ ":goldfish-control-device-test" ] |
| test_specs = { |
| log_settings = { |
| max_severity = "ERROR" |
| } |
| } |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":goldfish_control_composite-bind_test" ] |
| |
| if (target_cpu == "x64") { |
| deps += [ ":goldfish-control-device-test-package" ] |
| } |
| } |