summaryrefslogtreecommitdiff
path: root/rust-src/build.rs
diff options
context:
space:
mode:
authorThomas Bertschinger <tahbertschinger@gmail.com>2024-01-15 23:41:00 -0700
committerKent Overstreet <kent.overstreet@linux.dev>2024-01-16 01:46:41 -0500
commit0a284fc4ffcbb46f0a4b921415ef12a9c75fa05c (patch)
tree22aa82b7448833713ca975eb3c241f607742fc78 /rust-src/build.rs
parent249bf7b9d446092e1b744c366b7e8c4563a437f0 (diff)
convert main() from C to Rust
This moves the main() function from C to Rust. It also updates the name of the Rust package from "bcachefs-rust" to "bcachefs-tools". Signed-off-by: Thomas Bertschinger <tahbertschinger@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'rust-src/build.rs')
-rw-r--r--rust-src/build.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/rust-src/build.rs b/rust-src/build.rs
new file mode 100644
index 00000000..e4662bd7
--- /dev/null
+++ b/rust-src/build.rs
@@ -0,0 +1,21 @@
+fn main() {
+ println!("cargo:rustc-link-search=..");
+ println!("cargo:rerun-if-changed=../libbcachefs.a");
+ println!("cargo:rustc-link-lib=static:+whole-archive=bcachefs");
+
+ println!("cargo:rustc-link-lib=urcu");
+ println!("cargo:rustc-link-lib=zstd");
+ println!("cargo:rustc-link-lib=blkid");
+ println!("cargo:rustc-link-lib=uuid");
+ println!("cargo:rustc-link-lib=sodium");
+ println!("cargo:rustc-link-lib=z");
+ println!("cargo:rustc-link-lib=lz4");
+ println!("cargo:rustc-link-lib=zstd");
+ println!("cargo:rustc-link-lib=udev");
+ println!("cargo:rustc-link-lib=keyutils");
+ println!("cargo:rustc-link-lib=aio");
+
+ if std::env::var("BCACHEFS_FUSE").is_ok() {
+ println!("cargo:rustc-link-lib=fuse3");
+ }
+}