Cleaner include path check
This commit is contained in:
parent
59483981d2
commit
13ef735d35
@ -658,15 +658,15 @@ fn generate_bindings(config: &Config) {
|
||||
.clang_arg("--sysroot")
|
||||
.clang_arg(sysroot.display().to_string());
|
||||
|
||||
let c_target = format!(
|
||||
"{}-{}-{}",
|
||||
&config.target_arch, &config.target_os, &config.target_env
|
||||
);
|
||||
|
||||
// we need to add special platform header file with env for support cross building
|
||||
let header = format!("{}/usr/include/{}", sysroot.display(), c_target);
|
||||
if PathBuf::from(&header).is_dir() {
|
||||
builder = builder.clang_arg("-I").clang_arg(&header);
|
||||
let target_include_dir = sysroot.join(format!(
|
||||
"usr/include/{}-{}-{}",
|
||||
config.target_arch, config.target_os, config.target_env
|
||||
));
|
||||
if target_include_dir.is_dir() {
|
||||
builder = builder
|
||||
.clang_arg("-I")
|
||||
.clang_arg(target_include_dir.display().to_string());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user