Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add LIB_SYS_TRY_SHARED ENV var to try to link with shared library #206

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,12 @@ fn main() {
// Apple platforms have libz.1.dylib, and it's usually available even when
// cross compiling (via fat binary or in the target's Xcode SDK)
let cross_compiling = target != host;
let try_link_with_shared =
env::var("LIB_SYS_TRY_SHARED").unwrap_or(String::new()) == "1";
if target.contains("msvc")
|| target.contains("pc-windows-gnu")
|| want_static
|| (cross_compiling && !target.contains("-apple-"))
|| !try_link_with_shared && (cross_compiling && !target.contains("-apple-"))
{
return build_zlib(&mut cfg, &target);
}
Expand Down
Loading