Find package. By default, it will try to find vcpkg first, then homebrew(currently only for Mac M1). If building for linux and feature "linux-pkg-config" is enabled, will try to use pkg-config unless check fails (e.g. NO_PKG_CONFIG_libyuv=1)
(name: &str)
| 131 | /// If building for linux and feature "linux-pkg-config" is enabled, will try to use pkg-config |
| 132 | /// unless check fails (e.g. NO_PKG_CONFIG_libyuv=1) |
| 133 | fn find_package(name: &str) -> Vec<PathBuf> { |
| 134 | let no_pkg_config_var_name = format!("NO_PKG_CONFIG_{name}"); |
| 135 | println!("cargo:rerun-if-env-changed={no_pkg_config_var_name}"); |
| 136 | if cfg!(all(target_os = "linux", feature = "linux-pkg-config")) |
| 137 | && std::env::var(no_pkg_config_var_name).as_deref() != Ok("1") |
| 138 | { |
| 139 | link_pkg_config(name) |
| 140 | } else if let Ok(vcpkg_root) = std::env::var("VCPKG_ROOT") { |
| 141 | vec![link_vcpkg(vcpkg_root.into(), name)] |
| 142 | } else { |
| 143 | // Try using homebrew |
| 144 | vec![link_homebrew_m1(name)] |
| 145 | } |
| 146 | } |
| 147 | |
| 148 | fn generate_bindings( |
| 149 | ffi_header: &Path, |
no test coverage detected