1
0
mirror of https://github.com/bspeice/aeron-rs synced 2024-12-22 05:48:10 -05:00

Fix the DLL path on Windows

Static builds aren't working missing some symbols on Windows
This commit is contained in:
Bradlee Speice 2019-09-21 14:02:11 -04:00
parent e7aae43746
commit b1493fc0fd
2 changed files with 15 additions and 6 deletions

View File

@ -18,7 +18,7 @@ script:
- cd aeron_driver-sys - cd aeron_driver-sys
- cargo test - cargo test
- cargo test --release - cargo test --release
- cargo test --features "static" #- cargo test --features "static"
- cd .. - cd ..
- cargo test - cargo test

View File

@ -52,18 +52,27 @@ pub fn main() {
// Trying to figure out the final path is a bit weird; // Trying to figure out the final path is a bit weird;
// For Linux/OSX, it's just build/lib // For Linux/OSX, it's just build/lib
// For Windows, it's build/lib/{profile} // For Windows, the .lib file is in build/lib/{profile}, but the DLL
let base_lib_dir = cmake_output.join("build").join("lib"); // is shipped in build/binaries/{profile}
println!("cargo:rustc-link-search=native={}", base_lib_dir.display()); let base_lib_dir = cmake_output.join("build");
println!("cargo:rustc-link-search=native={}", base_lib_dir.join("lib").display());
// Because the `cmake_output` path is different for debug/release, we're not worried // Because the `cmake_output` path is different for debug/release, we're not worried
// about accidentally linking in the wrong library // about accidentally linking in the wrong library
println!( println!(
"cargo:rustc-link-search=native={}", "cargo:rustc-link-search=native={}",
base_lib_dir.join("Debug").display() base_lib_dir.join("lib/Debug").display()
); );
println!( println!(
"cargo:rustc-link-search=native={}", "cargo:rustc-link-search=native={}",
base_lib_dir.join("Release").display() base_lib_dir.join("binaries/Debug").display()
);
println!(
"cargo:rustc-link-search=native={}",
base_lib_dir.join("lib/Release").display()
);
println!(
"cargo:rustc-link-search=native={}",
base_lib_dir.join("binaries/Release").display()
); );
println!("cargo:include={}", header_path.display()); println!("cargo:include={}", header_path.display());