Crate foreman [] [src]

foreman: Rust build script assistant

"Don't pick up those environment variables yourself. Just tell the foreman what to do with the cargo."

This crate contains utilities for build scripts to talk to Cargo, abstracting away the input (via special environment variables that Cargo sets) and output (via special patterns that the build script prints to stdout).

Structs

Error

The Error type.

Enums

ErrorKind

The kind of an error.

LibKind

Library kind for rustc-link-lib

Profile

A compilation profile (see cargo docs)

SearchKind

Search strategy for rustc-link-search

Traits

ResultExt

Additional methods for Result, for easy interaction with this crate.

Functions

cfg

Pass a cfg flag to the compiler

debug

Get the debug mode of the current compilation

dep_metadata

Get a list of all the metadata passed along from dependency build scripts (see cargo docs)

env_var

Set a variable in the compiler's environment

features

Get the list of activated features (if any)

host

Get the host triple of the current compiler

link_lib

Pass a library to the compiler as a -l flag

link_search

Pass a library search path to the compiler as a -L flag

manifest_dir

Get the directory contains Cargo.toml

manifest_links

Get the value of the links key in Cargo.toml (if present)

meta

Pass metadata to dependent crates (see cargo docs)

num_jobs

Get the top-level parallelism number (e.g. for passing to make -jN)

opt_level

Get the optimization level of the current compilation

out_dir

Get the output directory (write generated files here)

profile

Get the compilation profile

rerun

Specify a file or directory whose timestamp will trigger a rerun of the build script (note: to recursively track a directory, see rerun_walk)

rerun_env

Specify environment variables where new values will trigger a rerun of the build script

rerun_walk

Recursively walk a directory, calling the provided callback for each file and directory, and if it returns true, tell cargo to trigger a rerun of the build script. Hidden files are included, but errors are ignored (so directories that you do not have permission to access will be silently skipped).

rustc

Get the path to the compiler that Cargo is using

rustdoc

Get the path to the documentation generator that Cargo is using

target

Get the target triple of the current compilation

warning

Emit a warning

Type Definitions

Result

Convenient wrapper around std::Result.