MCPcopy Create free account
hub / github.com/Recordscript/recordscript / find_package

Function find_package

libs/scrap/build.rs:133–146  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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)
133fn 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
148fn generate_bindings(
149 ffi_header: &Path,

Callers 2

gen_vcpkg_packageFunction · 0.85
mainFunction · 0.85

Calls 1

link_pkg_configFunction · 0.85

Tested by

no test coverage detected