blob: d7d867729e8104c339edc5d1eef76c5c4d4eb94d [file]
# 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/config/fuchsia/rules.gni")
import("//build/driver_package.gni")
import("//build/test.gni")
import("//build/test/test_package.gni")
import("//src/sys/build/components.gni")
bind_rules("goldfish-sync-bind") {
rules = "goldfish_sync.bind"
output = "goldfish_sync-bind.h"
tests = "tests.json"
deps = [ "//src/devices/bind/fuchsia.acpi" ]
}
source_set("common_deps") {
public_deps = [
":goldfish-sync-bind",
"//sdk/banjo/fuchsia.hardware.acpi",
"//sdk/banjo/fuchsia.hardware.goldfish.sync",
"//sdk/fidl/fuchsia.hardware.goldfish:fuchsia.hardware.goldfish_llcpp",
"//src/devices/lib/driver",
"//src/devices/lib/mmio",
"//src/lib/ddk",
"//src/lib/ddktl",
"//zircon/public/lib/fbl",
"//zircon/public/lib/fidl-llcpp",
"//zircon/public/lib/zircon-internal",
"//zircon/public/lib/zx",
"//zircon/system/ulib/async-loop:async-loop-cpp",
"//zircon/system/ulib/trace",
"//zircon/system/ulib/trace:trace-driver",
]
}
driver_module("goldfish_sync_driver") {
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" ]
# TODO(fxbug.dev/69585): This target uses raw zx::channel with LLCPP which is deprecated.
# Please migrate to typed channel APIs (fidl::ClientEnd<T>, fidl::ServerEnd<T>).
# See linked bug for details.
configs += [ "//build/cpp:fidl-llcpp-deprecated-raw-channels" ]
}
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",
"//sdk/banjo/fuchsia.hardware.acpi:fuchsia.hardware.acpi_mock",
"//src/devices/testing/fake-bti",
"//src/devices/testing/fake_ddk",
"//zircon/public/lib/mock-function",
"//zircon/public/lib/sync",
"//zircon/public/lib/zircon-internal",
"//zircon/public/lib/zx",
"//zircon/public/lib/zxtest",
"//zircon/system/ulib/fzl",
"//zircon/system/ulib/mmio-ptr:mmio-ptr-fake",
]
configs += [ "//build/config:all_source" ]
# TODO(fxbug.dev/69585): This target uses raw zx::channel with LLCPP which is deprecated.
# Please migrate to typed channel APIs (fidl::ClientEnd<T>, fidl::ServerEnd<T>).
# See linked bug for details.
configs += [ "//build/cpp:fidl-llcpp-deprecated-raw-channels" ]
}
fuchsia_unittest_package("goldfish-sync-device-test-package") {
package_name = "goldfish-sync-device-test"
deps = [ ":goldfish-sync-device-test" ]
}
driver_package("goldfish_sync") {
deps = [ ":goldfish_sync_driver" ]
drivers = [
{
name = "goldfish_sync.so"
},
]
}
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" ]
}
}