| # 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/go/go_binary.gni") | |
| import("//build/go/go_library.gni") | |
| import("//build/go/go_test.gni") | |
| go_library("virtual_device") { | |
| sources = [ | |
| "aemu.go", | |
| "common.go", | |
| "common_test.go", | |
| "doc.go", | |
| "qemu.go", | |
| "qemu_test.go", | |
| ] | |
| deps = [ | |
| ":proto", | |
| "//third_party/golibs:github.com/google/go-cmp", | |
| "//tools/build", | |
| "//tools/qemu", | |
| ] | |
| } | |
| go_test("virtual_device_test") { | |
| output_name = "virtual_device_test" | |
| gopackages = [ "go.fuchsia.dev/fuchsia/tools/virtual_device" ] | |
| deps = [ ":virtual_device" ] | |
| } | |
| go_library("fvd_lib") { | |
| source_dir = "cmd/fvd" | |
| sources = [ "main.go" ] | |
| deps = [ | |
| ":proto", | |
| ":virtual_device", | |
| "//third_party/golibs:google.golang.org/protobuf", | |
| "//tools/build", | |
| "//tools/lib/jsonutil", | |
| ] | |
| } | |
| group("tests") { | |
| testonly = true | |
| deps = [ ":virtual_device_test" ] | |
| } | |
| go_binary("fvd") { | |
| gopackage = "go.fuchsia.dev/fuchsia/tools/virtual_device/cmd/fvd" | |
| deps = [ ":fvd_lib" ] | |
| } | |
| # Generates $root_build_dir/default.fvd. | |
| action("default") { | |
| script = "$host_out_dir/fvd" | |
| outputs = [ "$root_build_dir/default.fvd" ] | |
| args = [ | |
| # images.json is built before this target even though it is not a dep. | |
| "--images_json", | |
| rebase_path("$root_build_dir/images.json", root_build_dir), | |
| "--output", | |
| rebase_path(outputs[0], root_build_dir), | |
| "--buildinfo_cpu", | |
| target_cpu, | |
| ] | |
| deps = [ ":fvd($host_platform)" ] | |
| } | |
| go_library("proto") { | |
| source_dir = "proto" | |
| sources = [ "virtual_device.pb.go" ] | |
| deps = [ "//third_party/golibs:google.golang.org/protobuf" ] | |
| non_go_deps = [ "proto:lib" ] | |
| } |