Skip to content

Commit

Permalink
ohos: Linked shared lib on OpenHarmony
Browse files Browse the repository at this point in the history
The OpenHarmony SDK / sysroot contains libz.so
and similar to android we can assume that libz
will always be available.
  • Loading branch information
jschwe committed Oct 2, 2024
1 parent f656726 commit 8a9b7f7
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ fn main() {
}

// All android compilers should come with libz by default, so let's just use
// the one already there. Likewise, Haiku always ships with libz, so we can
// link to it even when cross-compiling.
if target.contains("android") || target.contains("haiku") {
// the one already there. Likewise, Haiku and OpenHarmony always ship with libz,
// so we can link to it even when cross-compiling.
if target.contains("android") || target.contains("haiku") || target.ends_with("-ohos") {
println!("cargo:rustc-link-lib=z");
return;
}
Expand Down Expand Up @@ -60,7 +60,10 @@ fn main() {
}
}
Err(e) => {
println!("cargo:warning=Could not find zlib include paths via pkg-config: {}", e)
println!(
"cargo:warning=Could not find zlib include paths via pkg-config: {}",
e
)
}
}
}
Expand Down

0 comments on commit 8a9b7f7

Please sign in to comment.