Skip to content

Commit 75d5de3

Browse files
committed
fix linker libraries for x86_64-pc-windows-gnu target
1 parent 411c016 commit 75d5de3

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

libssh-rs-sys/build.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,8 +260,15 @@ fn main() {
260260
cfg.compile("libssh");
261261

262262
if target.contains("windows") {
263-
println!("cargo:rustc-link-lib=libcrypto");
264-
println!("cargo:rustc-link-lib=libssl");
263+
if target.contains("windows-msvc") {
264+
// target `windows-msvc` expects `lib` prefix
265+
println!("cargo:rustc-link-lib=libcrypto");
266+
println!("cargo:rustc-link-lib=libssl");
267+
} else {
268+
// target `windows-gnu` adds the `lib` prefix
269+
println!("cargo:rustc-link-lib=crypto");
270+
println!("cargo:rustc-link-lib=ssl");
271+
}
265272
println!("cargo:rustc-link-lib=crypt32");
266273
println!("cargo:rustc-link-lib=user32");
267274
println!("cargo:rustc-link-lib=shell32");

0 commit comments

Comments
 (0)