mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
libservo: Make background hang monitor integration optional. (#35256)
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
parent
c4f4d5cc04
commit
cdd6660113
4 changed files with 12 additions and 5 deletions
|
@ -23,9 +23,12 @@ libc = { workspace = true }
|
|||
log = { workspace = true }
|
||||
serde_json = { workspace = true }
|
||||
|
||||
[features]
|
||||
sampler = ["unwind-sys", "mach2"]
|
||||
|
||||
[target.'cfg(target_os = "macos")'.dependencies]
|
||||
mach2 = "0.4"
|
||||
mach2 = { version = "0.4", optional = true }
|
||||
|
||||
[target.'cfg(all(target_os = "linux", not(any(target_arch = "arm", target_arch = "aarch64", target_env = "ohos", target_env = "musl"))))'.dependencies]
|
||||
nix = { workspace = true, features = ["signal"] }
|
||||
unwind-sys = "0.1.4"
|
||||
unwind-sys = { version = "0.1.4", optional = true }
|
||||
|
|
|
@ -90,13 +90,15 @@ impl BackgroundHangMonitorRegister for HangMonitorRegister {
|
|||
);
|
||||
|
||||
#[cfg(all(
|
||||
feature = "sampler",
|
||||
target_os = "windows",
|
||||
any(target_arch = "x86_64", target_arch = "x86")
|
||||
))]
|
||||
let sampler = crate::sampler_windows::WindowsSampler::new_boxed();
|
||||
#[cfg(target_os = "macos")]
|
||||
#[cfg(all(feature = "sampler", target_os = "macos"))]
|
||||
let sampler = crate::sampler_mac::MacOsSampler::new_boxed();
|
||||
#[cfg(all(
|
||||
feature = "sampler",
|
||||
target_os = "linux",
|
||||
not(any(
|
||||
target_arch = "arm",
|
||||
|
@ -107,6 +109,7 @@ impl BackgroundHangMonitorRegister for HangMonitorRegister {
|
|||
))]
|
||||
let sampler = crate::sampler_linux::LinuxSampler::new_boxed();
|
||||
#[cfg(any(
|
||||
not(feature = "sampler"),
|
||||
target_os = "android",
|
||||
all(
|
||||
target_os = "linux",
|
||||
|
@ -116,7 +119,7 @@ impl BackgroundHangMonitorRegister for HangMonitorRegister {
|
|||
target_env = "ohos",
|
||||
target_env = "musl"
|
||||
)
|
||||
)
|
||||
),
|
||||
))]
|
||||
let sampler = crate::sampler::DummySampler::new_boxed();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue