]> git.sesse.net Git - bcachefs-tools-debian/commitdiff
bch_bindgen: add liburcu paths by pkgconfig
authorxhe <xw897002528@gmail.com>
Sun, 21 Jan 2024 11:04:31 +0000 (19:04 +0800)
committerxhe <xw897002528@gmail.com>
Sun, 21 Jan 2024 11:04:31 +0000 (19:04 +0800)
Signed-off-by: xhe <xw897002528@gmail.com>
bch_bindgen/build.rs

index 35f5d413dbadebf9040fdf9b4b50bc42f6975703..5395807c7ba3a22f3a724f21b9759731bbabc240 100644 (file)
@@ -19,6 +19,7 @@ fn main() {
         .expect("ENV Var 'CARGO_MANIFEST_DIR' Expected")
         .into();
 
+    let urcu = pkg_config::probe_library("liburcu").expect("Failed to find urcu lib");
     let bindings = bindgen::builder()
         .header(
             top_dir
@@ -27,6 +28,12 @@ fn main() {
                 .display()
                 .to_string(),
         )
+        .clang_args(
+            urcu
+                .include_paths
+                .iter()
+                .map(|p| format!("-I{}", p.display())),
+        )
         .clang_arg("-I..")
         .clang_arg("-I../c_src")
         .clang_arg("-I../include")