-
Notifications
You must be signed in to change notification settings - Fork 11
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
Misc build-related fixes #2
Conversation
pkg-config needs the ability to be re-enabled if `default-features` are set to false. This cannot be done outside of an extra feature flag, so feature `pkgconfig` is added. Also, `libevent-sys` is added to `libevent-rs` without default features, so they can be controlled entirely from the latter.
`FindOpenSSL` relies on this, so map the `DEP_OPENSSL_ROOT` supplied by `openssl-sys` (or try to create using `DEP_OPENSSL_INCLUDE`).
@@ -30,6 +30,18 @@ fn build_libevent(libevent_path: impl AsRef<std::path::Path>) -> PathBuf { | |||
} | |||
|
|||
config.register_dep("openssl"); | |||
|
|||
let openssl_root = if let Ok(root) = env::var("DEP_OPENSSL_ROOT") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For posterity, this metadata was only added in openssl-sys 0.9.48 (sfackler/rust-openssl@ef86438), and the logic here exists to be backwards-compatible with earlier versions.
static = [ "libevent-sys/static" ] | ||
pkgconfig = [ "libevent-sys/pkgconfig" ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If a package is optional you can include it the same as you'd include a feature - so this can just be libevent-sys/pkg-config
and you can remove the named feature in the libevent-sys
crate. Additionally you could just add the feature libevent-sys/pkg-config
to your default
config and get rid of all the pkgconfig
aliases.
Fixes a few issues seen when cross-compiling, and also when building from OSX:
pkgconfig
to be able to re-enable pkg-config support when building withdefault-features = false
.clang_arg
for bindgen. There were issues encountered when cross-compiling, and it gets discovered by bindgen internally, anyway. I still haven't looked into the code path discrepancies, but I suspect there might be an issue with not also setting the sysroot. TBD.OPENSSL_ROOT_DIR
into cmake when doing bundled builds.FindOpenSSL.cmake
needs this.Also included are some additions for verbose building.