Skip to content

Commit fe410cd

Browse files
committed
Disable cargo metadata in pkg-config probe
We were notified that cargo metadata is enabled by default when probing with pkg-config. This can cause breakage in cases where cross-compilation is done. Disabling the cargo metadata explicitly seems to resolve the problem.
1 parent 4576002 commit fe410cd

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

libcryptsetup-rs-sys/build.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ use std::path::PathBuf;
88
fn probe() -> Library {
99
match Config::new()
1010
.atleast_version("2.2.0")
11+
.cargo_metadata(false)
1112
.probe("libcryptsetup")
1213
{
1314
Ok(l) => l,
@@ -23,11 +24,12 @@ fn build_safe_free() {
2324

2425
fn generate_bindings(library: &Library, safe_free_is_needed: bool) {
2526
let builder = bindgen::Builder::default()
26-
.clang_args(library.include_paths.iter().map(|path| {
27-
let r = format!("-I{}", path.to_string_lossy());
28-
eprintln!("{}", r);
29-
r
30-
}))
27+
.clang_args(
28+
library
29+
.include_paths
30+
.iter()
31+
.map(|path| format!("-I{}", path.display())),
32+
)
3133
.header("header.h")
3234
.size_t_is_usize(true);
3335
#[cfg(target_arch = "x86")]

0 commit comments

Comments
 (0)