fixing build

This commit is contained in:
Abhijeet Patil
2024-01-17 22:43:20 +00:00
parent 8a67dc396d
commit f8a8ff8184

View File

@@ -6,6 +6,13 @@ use std::{env, path::PathBuf, process::Command};
use anyhow::{anyhow, Context};
use bindgen::CargoCallbacks;
#[cfg(debug_assertions)]
pub(crate) fn enable_build_sanitizers_in_debug() {
println!("cargo:rustc-link-arg=-fsanitize=address");
println!("cargo:rustc-link-arg=-fsanitize=undefined");
println!("cargo:rustc-link-arg=-static-libsan");
}
fn main() -> anyhow::Result<()> {
// Tell cargo to invalidate the built crate whenever the wrapper changes
println!("cargo:rerun-if-changed=bindgen_deps.h");
@@ -115,10 +122,3 @@ fn main() -> anyhow::Result<()> {
Ok(())
}
#[cfg(debug_assertions)]
pub(crate) fn enable_build_sanitizers_in_debug() {
println!("cargo:rustc-link-arg=-fsanitize=address");
println!("cargo:rustc-link-arg=-fsanitize=undefined");
println!("cargo:rustc-link-arg=-static-libsan");
}