Skip to content

Commit

Permalink
use cc_env instead of path to set the CC configure variable
Browse files Browse the repository at this point in the history
this allows wrappers like sccache to work properly
  • Loading branch information
doy-materialize committed Jun 21, 2024
1 parent c591de6 commit c5be04f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,11 @@ impl Build {
let mut cc = cc::Build::new();
cc.target(target).host(host).warnings(false).opt_level(2);
let compiler = cc.get_compiler();
configure.env("CC", compiler.path());
let mut cc_env = compiler.cc_env();
if cc_env.is_empty() {
cc_env = compiler.path().to_path_buf().into_os_string();
}
configure.env("CC", cc_env);
let path = compiler.path().to_str().unwrap();

// Both `cc::Build` and `./Configure` take into account
Expand Down

0 comments on commit c5be04f

Please sign in to comment.