Skip to content

Use the selected CC/CXX in crates that build with gcc-rs. #42206

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/bootstrap/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,13 @@ pub fn rustc(build: &Build, target: &str, compiler: &Compiler) {
if let Some(s) = target_config.and_then(|c| c.llvm_config.as_ref()) {
cargo.env("CFG_LLVM_ROOT", s);
}
// Set CC and CXX for crates that use extern crate gcc.
if let Some(s) = target_config.and_then(|c| c.cc.as_ref()) {
cargo.env("CC", s);
}
if let Some(s) = target_config.and_then(|c| c.cxx.as_ref()) {
cargo.env("CXX", s);
}
// Building with a static libstdc++ is only supported on linux right now,
// not for MSVC or macOS
if build.config.llvm_static_stdcpp &&
Expand Down