Skip to content

Commit

Permalink
Add log to mention what GCC path the build script is using and where …
Browse files Browse the repository at this point in the history
…it comes from
  • Loading branch information
GuillaumeGomez committed Jan 24, 2025
1 parent 4798615 commit b8218f0
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions build_system/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,11 @@ impl ConfigInfo {
pub fn setup_gcc_path(&mut self) -> Result<(), String> {
// If the user used the `--gcc-path` option, no need to look at `config.toml` content
// since we already have everything we need.
if self.gcc_path.is_some() {
if let Some(gcc_path) = &self.gcc_path {
println!(
"`--gcc-path` was provided, ignoring config file. Using `{}` as path for libgccjit",
gcc_path
);
return Ok(());
}
let config_file = match self.config_file.as_deref() {
Expand All @@ -297,10 +301,15 @@ impl ConfigInfo {
self.download_gccjit_if_needed()?;
return Ok(());
}
if gcc_path.is_none() {
let Some(gcc_path) = gcc_path else {
return Err(format!("missing `gcc-path` value from `{}`", config_file.display()));
}
self.gcc_path = gcc_path;
};
println!(
"GCC path retrieved from `{}`. Using `{}` as path for libgccjit",
config_file.display(),
gcc_path
);
self.gcc_path = Some(gcc_path);
Ok(())
}

Expand Down

0 comments on commit b8218f0

Please sign in to comment.