diff --git a/libs/walproposer/build.rs b/libs/walproposer/build.rs index 2805429bac..69a8a3d583 100644 --- a/libs/walproposer/build.rs +++ b/libs/walproposer/build.rs @@ -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"); -}