Add NetBSD support
This commit is contained in:
parent
f19ceeb8e0
commit
0f8cd7a9c8
7 changed files with 25 additions and 24 deletions
|
|
@ -8,7 +8,7 @@ use cpal::traits::{DeviceTrait, HostTrait, StreamTrait};
|
|||
#[derive(Debug)]
|
||||
struct Opt {
|
||||
#[cfg(all(
|
||||
any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd"),
|
||||
any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd", target_os = "netbsd"),
|
||||
feature = "jack"
|
||||
))]
|
||||
jack: bool,
|
||||
|
|
@ -20,7 +20,7 @@ impl Opt {
|
|||
fn from_args() -> Self {
|
||||
let app = clap::Command::new("beep").arg(arg!([DEVICE] "The audio device to use"));
|
||||
#[cfg(all(
|
||||
any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd"),
|
||||
any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd", target_os = "netbsd"),
|
||||
feature = "jack"
|
||||
))]
|
||||
let app = app.arg(arg!(-j --jack "Use the JACK host"));
|
||||
|
|
@ -28,7 +28,7 @@ impl Opt {
|
|||
let device = matches.value_of("DEVICE").unwrap_or("default").to_string();
|
||||
|
||||
#[cfg(all(
|
||||
any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd"),
|
||||
any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd", target_os = "netbsd"),
|
||||
feature = "jack"
|
||||
))]
|
||||
return Opt {
|
||||
|
|
@ -37,7 +37,7 @@ impl Opt {
|
|||
};
|
||||
|
||||
#[cfg(any(
|
||||
not(any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd")),
|
||||
not(any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd", target_os = "netbsd")),
|
||||
not(feature = "jack")
|
||||
))]
|
||||
Opt { device }
|
||||
|
|
@ -49,7 +49,7 @@ fn main() -> anyhow::Result<()> {
|
|||
|
||||
// Conditionally compile with jack if the feature is specified.
|
||||
#[cfg(all(
|
||||
any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd"),
|
||||
any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd", target_os = "netbsd"),
|
||||
feature = "jack"
|
||||
))]
|
||||
// Manually check for flags. Can be passed through cargo with -- e.g.
|
||||
|
|
@ -66,7 +66,7 @@ fn main() -> anyhow::Result<()> {
|
|||
};
|
||||
|
||||
#[cfg(any(
|
||||
not(any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd")),
|
||||
not(any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd", target_os = "netbsd")),
|
||||
not(feature = "jack")
|
||||
))]
|
||||
let host = cpal::default_host();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue