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

Fix semver break of target_supported #128

Merged
merged 1 commit into from Dec 11, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/lib.rs
Expand Up @@ -246,6 +246,12 @@ pub fn probe_library(name: &str) -> Result<Library, Error> {
Config::new().probe(name)
}

#[doc(hidden)]
#[deprecated(note = "use config.target_supported() instance method instead")]
pub fn target_supported() -> bool {
Config::new().target_supported()
}

/// Run `pkg-config` to get the value of a variable from a package using
/// `--variable`.
///
Expand Down Expand Up @@ -394,6 +400,7 @@ impl Config {
Ok(library)
}

/// True if pkg-config is used for the host system, or configured for cross-compilation
pub fn target_supported(&self) -> bool {
let target = env::var_os("TARGET").unwrap_or_default();
let host = env::var_os("HOST").unwrap_or_default();
Expand Down