Skip to content

Commit e3f357c

Browse files
committed
Add the bin dir to cargo's search path on MSVC
That's where it contains the actual dlls needed at runtime
1 parent f9148f9 commit e3f357c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ pub struct Build {
2222
pub struct Artifacts {
2323
include_dir: PathBuf,
2424
lib_dir: PathBuf,
25+
bin_dir: PathBuf,
2526
libs: Vec<String>,
2627
target: String,
2728
shared: bool,
@@ -412,6 +413,7 @@ impl Build {
412413

413414
Artifacts {
414415
lib_dir: install_dir.join("lib"),
416+
bin_dir: install_dir.join("bin"),
415417
include_dir: install_dir.join("include"),
416418
libs: libs,
417419
target: target.to_string(),
@@ -529,6 +531,7 @@ impl Artifacts {
529531
println!("cargo:lib={}", self.lib_dir.display());
530532
if !self.shared && self.target.contains("msvc") {
531533
println!("cargo:rustc-link-lib=user32");
534+
println!("cargo:rustc-link-search=native={}", self.bin_dir.display());
532535
}
533536
}
534537
}

0 commit comments

Comments
 (0)