Only compile platform samplers when cargo feature enabled (#35312)

* background_hang_monitor: Only compile platform samplers when cargo feature enabled.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* background_hang_monitor: Make nix dependency optional.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
Josh Matthews 2025-02-06 01:53:08 -05:00 committed by GitHub
parent 0de6d1bc3a
commit 6b12499077
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 4 deletions

View file

@ -7,6 +7,7 @@
pub mod background_hang_monitor;
mod sampler;
#[cfg(all(
feature = "sampler",
target_os = "linux",
not(any(
target_arch = "arm",
@ -16,9 +17,9 @@ mod sampler;
))
))]
mod sampler_linux;
#[cfg(target_os = "macos")]
#[cfg(all(feature = "sampler", target_os = "macos"))]
mod sampler_mac;
#[cfg(target_os = "windows")]
#[cfg(all(feature = "sampler", target_os = "windows"))]
mod sampler_windows;
pub use self::background_hang_monitor::*;