aboutsummaryrefslogtreecommitdiff
path: root/nix-rust/local.mk
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2021-06-01 11:50:50 +0200
committerGitHub <noreply@github.com>2021-06-01 11:50:50 +0200
commit48396d940ee0f68080cfe99544a50a884b30fea6 (patch)
tree44dbb4d462447a84fca415f30e9a5532cc1b58aa /nix-rust/local.mk
parentb8fbfc80fd3c08daa2a3da5aad246ca8b0a72be1 (diff)
parentc57ab1768767ca4f860ce5ca5faf54a7dba4969f (diff)
Merge pull request #4866 from alyssais/libdl
Only link with libdl on Linux
Diffstat (limited to 'nix-rust/local.mk')
-rw-r--r--nix-rust/local.mk9
1 files changed, 7 insertions, 2 deletions
diff --git a/nix-rust/local.mk b/nix-rust/local.mk
index 50db4783c..9650cdf93 100644
--- a/nix-rust/local.mk
+++ b/nix-rust/local.mk
@@ -8,8 +8,13 @@ endif
libnixrust_PATH := $(d)/target/$(RUST_DIR)/libnixrust.$(SO_EXT)
libnixrust_INSTALL_PATH := $(libdir)/libnixrust.$(SO_EXT)
-libnixrust_LDFLAGS_USE := -L$(d)/target/$(RUST_DIR) -lnixrust -ldl
-libnixrust_LDFLAGS_USE_INSTALLED := -L$(libdir) -lnixrust -ldl
+libnixrust_LDFLAGS_USE := -L$(d)/target/$(RUST_DIR) -lnixrust
+libnixrust_LDFLAGS_USE_INSTALLED := -L$(libdir) -lnixrust
+
+ifeq ($(OS), Linux)
+libnixrust_LDFLAGS_USE += -ldl
+libnixrust_LDFLAGS_USE_INSTALLED += -ldl
+endif
ifeq ($(OS), Darwin)
libnixrust_BUILD_FLAGS = NIX_LDFLAGS="-undefined dynamic_lookup"