| # 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/test/test_package.gni") |
| |
| source_set("lib") { |
| visibility = [ ":*" ] |
| |
| sources = [ |
| "guest_config.cc", |
| "guest_config.h", |
| "instance_controller_impl.cc", |
| "instance_controller_impl.h", |
| "linux.cc", |
| "linux.h", |
| "zircon.cc", |
| "zircon.h", |
| ] |
| |
| public_deps = [ |
| "//garnet/bin/guest/third_party/fdt", |
| "//garnet/bin/guest/vmm/fidl:fuchsia.guest.vmm", |
| "//garnet/lib/machina", |
| "//garnet/lib/machina/device", |
| "//garnet/public/fidl/fuchsia.guest", |
| "//garnet/public/lib/fsl", |
| "//garnet/public/lib/ui/base_view/cpp", |
| "//third_party/rapidjson", |
| "//zircon/public/lib/async-loop-cpp", |
| "//zircon/public/lib/fbl", |
| "//zircon/public/lib/libzbi", |
| "//zircon/public/lib/trace-provider", |
| ] |
| |
| defines = [ "_ALL_SOURCE=1" ] |
| } |
| |
| executable("bin") { |
| output_name = "vmm" |
| |
| sources = [ |
| "main.cc", |
| ] |
| |
| deps = [ |
| ":lib", |
| ] |
| |
| defines = [ "_ALL_SOURCE=1" ] |
| } |
| |
| package("vmm") { |
| binary = "vmm" |
| |
| deps = [ |
| ":bin", |
| ] |
| |
| meta = [ |
| { |
| path = rebase_path("//garnet/bin/guest/vmm/meta/vmm.cmx") |
| dest = "vmm.cmx" |
| }, |
| ] |
| |
| if (target_cpu == "arm64") { |
| resources = [ |
| { |
| path = rebase_path("//garnet/lib/machina/arch/arm64/dts/board.dtb") |
| dest = "board.dtb" |
| }, |
| ] |
| } else if (target_cpu == "x64") { |
| resources = [ |
| { |
| path = rebase_path("//garnet/lib/machina/arch/x86/asl/dsdt.aml") |
| dest = "dsdt.aml" |
| }, |
| { |
| path = rebase_path("//garnet/lib/machina/arch/x86/asl/mcfg.aml") |
| dest = "mcfg.aml" |
| }, |
| ] |
| } |
| } |
| |
| executable("vmm_unittests") { |
| visibility = [ ":*" ] |
| testonly = true |
| |
| sources = [ |
| "guest_config_unittest.cc", |
| ] |
| |
| deps = [ |
| ":lib", |
| "//third_party/googletest:gtest_main", |
| "//zircon/public/lib/fbl", |
| ] |
| } |
| |
| test_package("vmm_tests") { |
| deps = [ |
| ":vmm_unittests", |
| "//garnet/bin/guest/vmm/device:device_tests", |
| "//garnet/bin/guest/vmm/device:device_unittests", |
| ] |
| |
| tests = [ |
| { |
| name = "device_unittests" |
| }, |
| { |
| name = "vmm_unittests" |
| }, |
| ] |
| tests += [ |
| { |
| name = "device_tests" |
| environments = [ |
| { |
| dimensions = { |
| device_type = "Intel NUC Kit NUC7i5DNHE" |
| } |
| }, |
| ] |
| }, |
| ] |
| } |