tenseleyflow/fussr / 5001b86

Browse files

Fix link order: use rustc-link-arg for proper library placement

Authored by espadonne
SHA
5001b864ef5adcb5f08dc8ef93f6e1a25df57885
Parents
09ef15f
Tree
d433671

2 changed files

StatusFile+-
M Cargo.toml 1 1
M build.rs 4 4
Cargo.tomlmodified
@@ -1,6 +1,6 @@
11
 [package]
22
 name = "fussr"
3
-version = "0.2.11"
3
+version = "0.2.12"
44
 edition = "2021"
55
 description = "A git staging TUI tool - Rust port of fuss"
66
 authors = ["Matthew Wolffe"]
build.rsmodified
@@ -1,7 +1,7 @@
11
 fn main() {
22
     // Explicitly link against libgit2 and libssh2
3
-    // This works around issues where the -sys crates' build.rs output
4
-    // isn't being properly processed by cargo
5
-    println!("cargo:rustc-link-lib=git2");
6
-    println!("cargo:rustc-link-lib=ssh2");
3
+    // Use link-arg to append to the END of the linker command line
4
+    // This ensures the libraries come AFTER the Rust code that needs them
5
+    println!("cargo:rustc-link-arg=-lgit2");
6
+    println!("cargo:rustc-link-arg=-lssh2");
77
 }