[][src]Macro cargo_emit::rustc_flags

macro_rules! rustc_flags {
    ($($flags:literal),+ $(,)?) => { ... };
    ($($flags:expr),+ $(,)?) => { ... };
}

Tells Cargo to pass $flags to the compiler.

As of this writing, only -l and -L flags are supported.

This is equivalent to:

println!("cargo:rustc-flags=$flags");

Examples

The $flags get concatenated into a single formatting string. Formatting runtime values can be done by passing subsequent values.

let git_rev_hash = //
cargo_emit::rustc_env!("MY_HASH", "{}", git_rev_hash);