mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
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:
parent
0de6d1bc3a
commit
6b12499077
2 changed files with 5 additions and 4 deletions
|
@ -24,11 +24,11 @@ log = { workspace = true }
|
||||||
serde_json = { workspace = true }
|
serde_json = { workspace = true }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
sampler = ["unwind-sys", "mach2"]
|
sampler = ["unwind-sys", "mach2", "nix"]
|
||||||
|
|
||||||
[target.'cfg(target_os = "macos")'.dependencies]
|
[target.'cfg(target_os = "macos")'.dependencies]
|
||||||
mach2 = { version = "0.4", optional = true }
|
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]
|
[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"] }
|
nix = { workspace = true, features = ["signal"], optional = true }
|
||||||
unwind-sys = { version = "0.1.4", optional = true }
|
unwind-sys = { version = "0.1.4", optional = true }
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
pub mod background_hang_monitor;
|
pub mod background_hang_monitor;
|
||||||
mod sampler;
|
mod sampler;
|
||||||
#[cfg(all(
|
#[cfg(all(
|
||||||
|
feature = "sampler",
|
||||||
target_os = "linux",
|
target_os = "linux",
|
||||||
not(any(
|
not(any(
|
||||||
target_arch = "arm",
|
target_arch = "arm",
|
||||||
|
@ -16,9 +17,9 @@ mod sampler;
|
||||||
))
|
))
|
||||||
))]
|
))]
|
||||||
mod sampler_linux;
|
mod sampler_linux;
|
||||||
#[cfg(target_os = "macos")]
|
#[cfg(all(feature = "sampler", target_os = "macos"))]
|
||||||
mod sampler_mac;
|
mod sampler_mac;
|
||||||
#[cfg(target_os = "windows")]
|
#[cfg(all(feature = "sampler", target_os = "windows"))]
|
||||||
mod sampler_windows;
|
mod sampler_windows;
|
||||||
|
|
||||||
pub use self::background_hang_monitor::*;
|
pub use self::background_hang_monitor::*;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue