Vendor dependencies for 0.3.0 release

This commit is contained in:
2025-09-27 10:29:08 -05:00
parent 0c8d39d483
commit 82ab7f317b
26803 changed files with 16134934 additions and 0 deletions

46
vendor/tracing-oslog/build.rs vendored Normal file
View File

@@ -0,0 +1,46 @@
use std::{env, path::PathBuf};
fn main() {
if env::var("CARGO_CFG_TARGET_VENDOR").expect("failed to get target vendor") != "apple" {
println!(
"cargo:warning=tracing-oslog is only available for Apple platforms, it will not log \
anything on other platforms!"
);
return;
}
let mut args = Vec::<String>::new();
let target_os = env::var("CARGO_CFG_TARGET_OS").expect("failed to get target os");
if target_os == "ios" {
let version = if "macabi" == env::var("CARGO_CFG_TARGET_ABI").unwrap_or_default() {
"14.0"
} else {
"10.0"
};
args.push(format!("-miphoneos-version-min={version}"));
} else if target_os == "macos" {
args.push("-mmacosx-version-min=10.12".to_owned());
}
let bindings = bindgen::Builder::default()
.header("wrapper.h")
.parse_callbacks(Box::new(bindgen::CargoCallbacks::new()))
.allowlist_function("_?os_activity_.*")
.allowlist_function("os_log_.*")
.allowlist_function("os_release")
.allowlist_function("wrapped_.*")
.allowlist_type("os_activity_.*")
.allowlist_type("os_log_.*")
.allowlist_var("_?os_activity_.*")
.allowlist_var("__dso_handle")
.clang_args(&args)
.generate()
.expect("Unable to generate bindings");
// Write the bindings to the $OUT_DIR/bindings.rs file.
let out_path = PathBuf::from(env::var("OUT_DIR").unwrap()).join("bindings.rs");
bindings
.write_to_file(out_path)
.expect("Couldn't write bindings!");
cc::Build::new().file("wrapper.c").compile("wrapper");
}