| # Copyright 2020 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/config/fuchsia/rules.gni") |
| import("//build/test.gni") |
| import("//build/test/test_package.gni") |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":virtio-gpu-test-package" ] |
| } |
| |
| source_set("gpu_lib") { |
| configs += [ "//build/config:all_source" ] |
| sources = [ "gpu.cc" ] |
| public_deps = [ |
| "//sdk/banjo/ddk.protocol.display.controller", |
| "//sdk/banjo/ddk.protocol.sysmem", |
| "//sdk/fidl/fuchsia.sysmem:fuchsia.sysmem_llcpp", |
| "//src/devices/bus/lib/virtio", |
| "//src/lib/ddktl", |
| "//zircon/system/ulib/image-format", |
| ] |
| } |
| |
| driver_module("virtio_gpu") { |
| configs += [ |
| "//build/config:all_source", |
| "//build/config/fuchsia:enable_zircon_asserts", |
| ] |
| configs -= [ "//build/config/fuchsia:no_cpp_standard_library" ] |
| configs += [ "//build/config/fuchsia:static_cpp_standard_library" ] |
| if (is_fuchsia) { |
| configs += [ "//build/unification/config:zircon-migrated" ] |
| } |
| sources = [ "gpu_driver.cc" ] |
| deps = [ |
| ":gpu_lib", |
| "//src/devices/bus/lib/virtio", |
| "//src/devices/lib/driver", |
| "//src/lib/ddktl", |
| ] |
| } |
| |
| test("virtio-gpu-test") { |
| output_name = "virtio-gpu-test-test" |
| if (is_fuchsia) { |
| configs += [ "//build/unification/config:zircon-migrated" ] |
| } |
| if (is_fuchsia) { |
| fdio_config = [ "//build/config/fuchsia:fdio_config" ] |
| if (configs + fdio_config - fdio_config != configs) { |
| configs -= fdio_config |
| } |
| } |
| sources = [ "gpu_test.cc" ] |
| deps = [ |
| ":gpu_lib", |
| "//src/devices/bus/lib/virtio", |
| "//src/devices/sysmem/testing/mock-sysmem", |
| "//src/devices/testing/fake-bti", |
| "//src/devices/testing/fake_ddk", |
| "//zircon/public/lib/zxtest", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| "//zircon/system/ulib/fidl-async:fidl-async-cpp", |
| ] |
| } |
| |
| unittest_package("virtio-gpu-test-package") { |
| package_name = "virtio-gpu-test" |
| deps = [ ":virtio-gpu-test" ] |
| |
| tests = [ |
| { |
| name = "virtio-gpu-test-test" |
| }, |
| ] |
| } |