Module rustc_wrapper

Module rustc_wrapper 

Source
Expand description

Utilities for generating and setting a rustc wrapper executable for cargo commands.

§Motivation

The custom rustc wrapper passes extra compiler flags to rustc. This is useful in cases where cargo won’t pass compiler flags to rustc for some compiler invocations (e.g. cargo doesn’t pass rustc flags to proc macros and build scripts when the --target flag is set).

Ref: https://doc.rust-lang.org/cargo/reference/config.html#buildrustflags

Ref: https://doc.rust-lang.org/cargo/reference/environment-variables.html#environment-variables-cargo-reads

Functions§

env_vars
Returns a list of env vars required to set a custom rustc wrapper and ABI cfg flags (if necessary).
generate
Generates a rustc wrapper executable and returns its path.