|  | # Copyright 2018 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/components.gni") | 
|  | import("//build/dist/resource.gni") | 
|  | import("//build/rust/rustc_library.gni") | 
|  |  | 
|  | rustc_library("library_loader") { | 
|  | version = "0.1.0" | 
|  | edition = "2018" | 
|  | with_unit_tests = true | 
|  |  | 
|  | deps = [ | 
|  | "//garnet/lib/rust/files_async", | 
|  | "//garnet/lib/rust/io_util", | 
|  | "//sdk/fidl/fuchsia.io:fuchsia.io-rustc", | 
|  | "//sdk/fidl/fuchsia.ldsvc:fuchsia.ldsvc-rustc", | 
|  | "//src/lib/fidl/rust/fidl", | 
|  | "//src/lib/fuchsia-async", | 
|  | "//src/lib/zircon/rust:fuchsia-zircon", | 
|  | "//third_party/rust_crates:anyhow", | 
|  | "//third_party/rust_crates:futures", | 
|  | "//third_party/rust_crates:log", | 
|  | "//third_party/rust_crates:thiserror", | 
|  | ] | 
|  |  | 
|  | sources = [ "src/lib.rs" ] | 
|  | } | 
|  |  | 
|  | # These are some extra files that are included in the test package under lib/config_test, for use in | 
|  | # the config_test unit test. This is necessary because the library loader must be able to load the | 
|  | # files using OPEN_RIGHT_EXECUTABLE/VMO_FLAG_EXEC, and the easiest way to provide a test directory | 
|  | # that supports that is a real pkgfs directory. | 
|  | # TODO(fxbug.dev/37534): Remove this once Rust vfs supports OPEN_RIGHT_EXECUTABLE | 
|  | resource("config_test_foo") { | 
|  | sources = [ "config_test_files/foo" ] | 
|  | outputs = [ "lib/config_test/foo" ] | 
|  | } | 
|  |  | 
|  | resource("config_test_bar_baz") { | 
|  | sources = [ "config_test_files/bar/baz" ] | 
|  | outputs = [ "lib/config_test/bar/baz" ] | 
|  | } | 
|  |  | 
|  | fuchsia_unittest_package("library_loader_tests") { | 
|  | deps = [ | 
|  | ":config_test_bar_baz", | 
|  | ":config_test_foo", | 
|  | ":library_loader_test", | 
|  | ] | 
|  | manifest = "meta/library_loader_tests.cmx" | 
|  | test_specs = { | 
|  | } | 
|  | } | 
|  |  | 
|  | group("tests") { | 
|  | testonly = true | 
|  | deps = [ ":library_loader_tests" ] | 
|  | } |