blob: cac0f2abacc720dd0b1b15283d6a4ad05c8159dc [file] [log] [blame] [edit]
# 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 target depends on that are not Rust libraries. This
# includes things like actions that generate Rust code. It typically doesn't
# need to be set.
#
# with_tests (optional)
# Builds tests associated with the library. This will create a
# `<name>-lib-test` test file in the output directory.
#
# 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",
"with_tests",
])
type = "lib"
}
}