| # 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/rust/rust_artifact.gni") |
| |
| # Defines a Rust library |
| # |
| # Parameters |
| # |
| # name |
| # Name of the crate as defined in its manifest file. If not specified, it is |
| # assumed to be the same as the target name. |
| # |
| # deps (optional) |
| # List of labels for Rust libraries this library depends on. |
| # |
| # non_rust_deps (optional) |
| # List of labels this package depends on that are not Rust libraries. This |
| # includes things like actions that generate Rust code. It typically doesn't |
| # need to be set. |
| # |
| # Example of usage: |
| # |
| # rust_library("foo") { |
| # name = "foo_rs" |
| # } |
| template("rust_library") { |
| rust_artifact(target_name) { |
| forward_variables_from(invoker, [ |
| "deps", |
| "name", |
| "non_rust_deps", |
| "source_dir", |
| ]) |
| type = "lib" |
| } |
| } |