| # Copyright 2021 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-sync-bind") { |
| rules = "meta/goldfish_sync.bind" |
| tests = "meta/tests.json" |
| deps = [ |
| "//sdk/fidl/fuchsia.hardware.interrupt:fuchsia.hardware.interrupt_bindlib", |
| "//src/devices/bind/fuchsia.acpi", |
| ] |
| } |
| |
| source_set("common_deps") { |
| public_deps = [ |
| ":goldfish-sync-bind", |
| "//sdk/fidl/fuchsia.hardware.goldfish:fuchsia.hardware.goldfish_cpp", |
| "//sdk/lib/async-loop:async-loop-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/mmio", |
| "//src/lib/ddk", |
| "//src/lib/ddktl", |
| "//zircon/system/ulib/fbl", |
| "//zircon/system/ulib/trace", |
| "//zircon/system/ulib/zircon-internal", |
| "//zircon/system/ulib/zx", |
| ] |
| } |
| |
| fuchsia_cc_driver("goldfish_sync_driver-driver") { |
| legacy = true |
| output_name = "goldfish_sync" |
| |
| sources = [ |
| "sync_common_defs.h", |
| "sync_device.cc", |
| "sync_device.h", |
| ] |
| |
| deps = [ ":common_deps" ] |
| |
| configs += [ "//build/config/fuchsia:enable_zircon_asserts" ] |
| |
| configs += [ "//build/config:all_source" ] |
| } |
| |
| fuchsia_driver_component("goldfish_sync_driver") { |
| component_name = "goldfish_sync" |
| deps = [ ":goldfish_sync_driver-driver" ] |
| info = "meta/goldfish_sync_driver-info.json" |
| manifest = "meta/goldfish_sync.cml" |
| } |
| |
| test("goldfish-sync-device-test") { |
| output_name = "goldfish-sync-device-test" |
| sources = [ |
| "sync_common_defs.h", |
| "sync_device.cc", |
| "sync_device.h", |
| "sync_device_test.cc", |
| ] |
| deps = [ |
| ":common_deps", |
| "//src/devices/lib/acpi/mock:mock-acpi", |
| "//src/devices/testing/fake-bti", |
| "//src/devices/testing/mock-ddk", |
| "//zircon/system/ulib/fzl", |
| "//zircon/system/ulib/mmio-ptr", |
| "//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" ] |
| |
| # TODO(https://fxbug.dev/42136089): delete the below and fix compiler warnings |
| configs += [ "//build/config:Wno-conversion" ] |
| } |
| |
| fuchsia_unittest_package("goldfish-sync-device-test-package") { |
| package_name = "goldfish-sync-device-test" |
| deps = [ ":goldfish-sync-device-test" ] |
| } |
| |
| fuchsia_driver_package("goldfish_sync") { |
| export_to_bazel = true |
| driver_components = [ ":goldfish_sync_driver" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":goldfish-sync-bind_test" ] |
| |
| # TODO(67872): goldfish-sync-device-test are flaky on arm64 qemu. We should |
| # re-enable it once we fixed the flakiness. |
| if (target_cpu == "x64") { |
| deps += [ ":goldfish-sync-device-test-package" ] |
| } |
| } |