Skip to content

Commit

Permalink
Fix mxre#40 by using different linking flags depending on rustc version
Browse files Browse the repository at this point in the history
  • Loading branch information
Noratrieb committed Jun 5, 2022
1 parent 1807bec commit c839134
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ path = "lib.rs"

[dependencies]
toml = "0.5"
version_check = "0.9.4"

[dev-dependencies]
# used for tests
Expand Down
7 changes: 6 additions & 1 deletion lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,12 @@ impl WindowsResource {
}

println!("cargo:rustc-link-search=native={}", output_dir);
println!("cargo:rustc-link-lib=static=resource");

if version_check::is_min_version("1.61.0").unwrap_or(true) {
println!("cargo:rustc-link-lib=static:+whole-archive=resource");
} else {
println!("cargo:rustc-link-lib=static=resource");
}

Ok(())
}
Expand Down

0 comments on commit c839134

Please sign in to comment.