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

Set DEP_Z_INCLUDE if zlib from vcpkg #198

Merged
merged 1 commit into from
Jul 13, 2024
Merged

Conversation

sagudev
Copy link
Contributor

@sagudev sagudev commented Jul 11, 2024

No description provided.

Copy link
Member

@Byron Byron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you elaborate?
Please also feel free to put the motivation into a comment so future readers find out about it more easily.

@sagudev
Copy link
Contributor Author

sagudev commented Jul 12, 2024

Could you elaborate? Please also feel free to put the motivation into a comment so future readers find out about it more easily.

Well, DEP_Z_INCLUDE is already set when zlib is found via pkg-config:

libz-sys/build.rs

Lines 44 to 53 in 50dfd55

Ok(zlib) => {
if !zlib.include_paths.is_empty() {
let paths = zlib
.include_paths
.iter()
.map(|s| s.display().to_string())
.collect::<Vec<_>>();
println!("cargo:include={}", paths.join(","));
}
}
so I see no reason why we wouldn't do the same for vcpkg (I somehow expected it already). This is useful for other build script to be able to get include dir of zlib in more cases, instead of doing queries themself.

@Byron
Copy link
Member

Byron commented Jul 12, 2024

Thanks!

Could you put the motivation/explanation above into the commit message so I can merge?

Thanks again.

DEP_Z_INCLUDE is already set when zlib is found via pkg-config, so let's do it for vcpkg too.
This is useful for other build script to be able to get include dir of zlib in more cases, instead of doing queries themself.
Copy link
Member

@Byron Byron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for contributing, much appreciated.

@Byron Byron merged commit 37d0a5d into rust-lang:main Jul 13, 2024
45 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants