summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Cherkashin <148123+andoriyu@users.noreply.github.com>2021-04-18 16:04:50 -0700
committerGitHub <noreply@github.com>2021-04-18 16:04:50 -0700
commitf6b3a7445b42fb064ea10c857f744798c048f87a (patch)
treea1b6dafccbb0cb499ae1522db22317dca7b58a13
parent3efee816b6dbab03f19f2c25d798db65cba7aa4f (diff)
downloadrust-libzfs-f6b3a7445b42fb064ea10c857f744798c048f87a.zip
Conditionally link libspl on FreeBSD
FreeBSD's version of `libnvpair` uses functions (for example `libspl_assertf`) from `libspl`. Right now build is broken on FreeBSD due to this.
-rw-r--r--nvpair-sys/build.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/nvpair-sys/build.rs b/nvpair-sys/build.rs
index ecb0ccc..155c74e 100644
--- a/nvpair-sys/build.rs
+++ b/nvpair-sys/build.rs
@@ -3,4 +3,8 @@ fn main() {
// FIXME: a bug exists in some versions of libnvpair causing it to depend on a symbol called
// `aok`, which is in `libzfs`.
println!("cargo:rustc-link-lib=zfs");
+ // nvpair uses functions from libspl on FreeBSD
+ if cfg!(target_os="freebsd") {
+ println!("cargo:rustc-link-lib=spl");
+ };
}