Skip to content

Commit

Permalink
Merge pull request rust-lang#609 from GuillaumeGomez/fix-use-system-gcc
Browse files Browse the repository at this point in the history
Fix `--use-system-gcc` option handling
  • Loading branch information
antoyo authored Jan 24, 2025
2 parents 5491581 + 12e73ae commit 9f33f84
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions build_system/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -320,12 +320,16 @@ impl ConfigInfo {
) -> Result<(), String> {
env.insert("CARGO_INCREMENTAL".to_string(), "0".to_string());

if self.gcc_path.is_none() && !use_system_gcc {
self.setup_gcc_path()?;
}
let gcc_path = self.gcc_path.clone().expect(
"The config module should have emitted an error if the GCC path wasn't provided",
);
let gcc_path = if !use_system_gcc {
if self.gcc_path.is_none() {
self.setup_gcc_path()?;
}
self.gcc_path.clone().expect(
"The config module should have emitted an error if the GCC path wasn't provided",
)
} else {
String::new()
};
env.insert("GCC_PATH".to_string(), gcc_path.clone());

if self.cargo_target_dir.is_empty() {
Expand Down

0 comments on commit 9f33f84

Please sign in to comment.