set CFG_OMIT_GIT_HASH=1 during builds when omit-git-hash is enabled
This commit is contained in:
parent
6eb3e97d55
commit
cd4adb8a3f
1 changed files with 7 additions and 0 deletions
|
|
@ -975,6 +975,13 @@ pub fn rustc_cargo_env(
|
|||
.env("CFG_RELEASE_CHANNEL", &builder.config.channel)
|
||||
.env("CFG_VERSION", builder.rust_version());
|
||||
|
||||
// Some tools like Cargo detect their own git information in build scripts. When omit-git-hash
|
||||
// is enabled in config.toml, we pass this environment variable to tell build scripts to avoid
|
||||
// detecting git information on their own.
|
||||
if builder.config.omit_git_hash {
|
||||
cargo.env("CFG_OMIT_GIT_HASH", "1");
|
||||
}
|
||||
|
||||
if let Some(backend) = builder.config.default_codegen_backend() {
|
||||
cargo.env("CFG_DEFAULT_CODEGEN_BACKEND", backend);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue