pub struct Build {
pub rule: RefCounted<String>,
pub outputs: AddOnlyVec<String>,
pub implicit_outputs: AddOnlyVec<String>,
pub dependencies: AddOnlyVec<String>,
pub implicit_dependencies: AddOnlyVec<String>,
pub order_only_dependencies: AddOnlyVec<String>,
pub validations: AddOnlyVec<String>,
pub variables: AddOnlyVec<Variable>,
}Expand description
A build edge, as defined by the build keyword
See https://ninja-build.org/manual.html#_build_statements
§Example
Since build edges are tied to rules, use RuleRef::build to create them.
use ninja_writer::*;
let ninja = Ninja::new();
let cc = ninja.rule("cc", "gcc $cflags -c $in -o $out");
cc.build(["foo.o"]).with(["foo.c"]);
assert_eq!(ninja.to_string(), r###"
rule cc
command = gcc $cflags -c $in -o $out
build foo.o: cc foo.c
"###);
Fields§
§rule: RefCounted<String>The rule name
outputs: AddOnlyVec<String>The list of outputs, as defined by build <outputs>:
implicit_outputs: AddOnlyVec<String>The list of implicit outputs.
dependencies: AddOnlyVec<String>The list of dependencies (inputs).
implicit_dependencies: AddOnlyVec<String>The list of implicit dependencies (inputs).
order_only_dependencies: AddOnlyVec<String>The list of order-only dependencies (inputs).
validations: AddOnlyVec<String>The list of validations.
variables: AddOnlyVec<Variable>The list of variables, as an indented block
Implementations§
Trait Implementations§
Source§impl BuildVariables for Build
impl BuildVariables for Build
Source§fn with(self, inputs: impl IntoIterator<Item = impl ToArg>) -> Self
fn with(self, inputs: impl IntoIterator<Item = impl ToArg>) -> Self
Add explicit dependencies (inputs) Read more
Source§fn with_implicit(self, inputs: impl IntoIterator<Item = impl ToArg>) -> Self
fn with_implicit(self, inputs: impl IntoIterator<Item = impl ToArg>) -> Self
Add implicit dependencies Read more
Source§fn with_order_only(self, inputs: impl IntoIterator<Item = impl ToArg>) -> Self
fn with_order_only(self, inputs: impl IntoIterator<Item = impl ToArg>) -> Self
Add order-only dependencies Read more
Source§fn validations(self, validations: impl IntoIterator<Item = impl ToArg>) -> Self
fn validations(self, validations: impl IntoIterator<Item = impl ToArg>) -> Self
Add validations Read more
Source§fn output_implicit(self, outputs: impl IntoIterator<Item = impl ToArg>) -> Self
fn output_implicit(self, outputs: impl IntoIterator<Item = impl ToArg>) -> Self
Add validations Read more
Source§impl RuleVariables for Build
impl RuleVariables for Build
Source§fn deps_msvc_prefix(self, msvc_deps_prefix: impl ToArg) -> Self
fn deps_msvc_prefix(self, msvc_deps_prefix: impl ToArg) -> Self
Source§fn description(self, desc: impl ToArg) -> Self
fn description(self, desc: impl ToArg) -> Self
Set the description of the rule to be printed during the build Read more
Source§fn pool_console(self) -> Self
fn pool_console(self) -> Self
Auto Trait Implementations§
impl !Freeze for Build
impl !RefUnwindSafe for Build
impl !Send for Build
impl !Sync for Build
impl Unpin for Build
impl UnwindSafe for Build
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more