| # Copyright 2017 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/package.gni") |
| |
| shared_library("machina") { |
| sources = [ |
| "block_dispatcher.cc", |
| "block_dispatcher.h", |
| "framebuffer_scanout.cc", |
| "framebuffer_scanout.h", |
| "gpu_bitmap.cc", |
| "gpu_bitmap.h", |
| "gpu_resource.cc", |
| "gpu_resource.h", |
| "gpu_scanout.cc", |
| "gpu_scanout.h", |
| "hid_event_source.cc", |
| "hid_event_source.h", |
| "input_dispatcher.cc", |
| "input_dispatcher.h", |
| "pci.cc", |
| "pci.h", |
| "virtio.cc", |
| "virtio.h", |
| "virtio_balloon.cc", |
| "virtio_balloon.h", |
| "virtio_block.cc", |
| "virtio_block.h", |
| "virtio_gpu.cc", |
| "virtio_gpu.h", |
| "virtio_input.cc", |
| "virtio_input.h", |
| "virtio_net.cc", |
| "virtio_net.h", |
| "virtio_pci.cc", |
| "virtio_pci.h", |
| ] |
| |
| if (current_cpu == "arm64") { |
| sources += [ |
| "arch/arm64/gic_distributor.cc", |
| "arch/arm64/gic_distributor.h", |
| "arch/arm64/pl011.cc", |
| "arch/arm64/pl011.h", |
| "arch/arm64/pl031.cc", |
| "arch/arm64/pl031.h", |
| ] |
| } |
| |
| if (current_cpu == "x64") { |
| sources += [ |
| "arch/x86/e820.cc", |
| "arch/x86/e820.h", |
| "arch/x86/i8250.cc", |
| "arch/x86/i8250.h", |
| "arch/x86/io_apic.cc", |
| "arch/x86/io_apic.h", |
| "arch/x86/io_port.cc", |
| "arch/x86/io_port.h", |
| "arch/x86/page_table.cc", |
| "arch/x86/page_table.h", |
| "arch/x86/tpm.h", |
| ] |
| } |
| |
| public_deps = [ |
| "//zircon/system/ulib/zx", |
| ] |
| |
| defines = [ "_ALL_SOURCE=1" ] |
| |
| deps = [ |
| "//garnet/public/lib/fxl", |
| "//zircon/system/ulib/async:cpp", |
| "//zircon/system/ulib/async:loop_cpp", |
| "//zircon/system/ulib/block-client", |
| "//zircon/system/ulib/fbl", |
| "//zircon/system/ulib/hypervisor", |
| "//zircon/system/ulib/zxcpp", |
| ] |
| |
| libs = [ |
| "fdio", |
| "hid", |
| "sync", |
| "virtio", |
| ] |
| |
| # TODO(ZX-1411): Add visibility annotations to code and remove this. |
| configs -= [ "//build/config:symbol_visibility_hidden" ] |
| } |
| |
| executable("machina_unittests") { |
| testonly = true |
| |
| sources = [ |
| "hid_event_source-unittest.cc", |
| "input_dispatcher-unittest.cc", |
| "pci-unittest.cc", |
| "run_all_unittests.cc", |
| "virtio-unittest.cc", |
| "virtio_block-unittest.cc", |
| "virtio_gpu-unittest.cc", |
| "virtio_net-unittest.cc", |
| "virtio_queue_fake.cc", |
| "virtio_queue_fake.h", |
| ] |
| |
| if (current_cpu == "x64") { |
| sources += [ "arch/x86/page_table-unittest.cc" ] |
| } |
| |
| deps = [ |
| ":machina", |
| "//third_party/gtest", |
| "//zircon/system/ulib/fbl", |
| ] |
| } |
| |
| package("machina_tests") { |
| testonly = true |
| system_image = true |
| |
| deps = [ |
| ":machina_unittests", |
| ] |
| |
| tests = [ { |
| name = "machina_unittests" |
| } ] |
| } |