Skip to content

Commit

Permalink
Added name key-val pair
Browse files Browse the repository at this point in the history
- In order to pass the name of compiled lib on different platform we
  pass the name of libfile through the name key.
  • Loading branch information
spector-9 committed Feb 5, 2024
1 parent a5b1d0c commit 6b8f424
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,11 @@ pub fn main() -> Result<()> {
// .build_arg(format!("-j{}", std::thread::available_parallelism()?.get()))
.build();

println!(
"cargo:rustc-link-search={}",
dst.join("lib").display()
);
println!("cargo:rustc-link-lib=static=jpeg");
println!("cargo:rustc-link-search={}", dst.join("lib").display());
let name = if cfg!(unix) { "jpeg" } else { "jpeg-static" };

println!("cargo:rustc-link-lib=static={name}");
println!("cargo:include={}", dst.join("include").display());

println!("cargo:name={name}");
Ok(())
}

0 comments on commit 6b8f424

Please sign in to comment.