Skip to content

Commit

Permalink
Merge pull request #128 from kornelski/targetfix
Browse files Browse the repository at this point in the history
Fix semver break of target_supported
  • Loading branch information
sdroege committed Dec 11, 2021
2 parents 81d3854 + f2bc50e commit f79d5bc
Showing 1 changed file with 7 additions and 0 deletions.
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

0 comments on commit f79d5bc

Please sign in to comment.