Skip to content

Commit

Permalink
add Windows as cfg case
Browse files Browse the repository at this point in the history
  • Loading branch information
slivingston committed Jan 2, 2025
1 parent 879aae2 commit 9b0b956
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ tokio = { version = "1.40", features = ["net", "rt", "signal", "sync"] }
[target.'cfg(target_os="linux")'.dependencies]
v4l = { version = "0.14", features = ["v4l2"] }

[target.'cfg(target_os="macos")'.dependencies]
[target.'cfg(any(target_os="macos", target_os = "windows"))'.dependencies]
openpnp_capture = "0.2.4"

[dependencies.clap]
Expand Down
6 changes: 3 additions & 3 deletions src/camera.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ use crate::check::Error as CheckError;
pub fn get_default_dev() -> String {
#[cfg(target_os = "linux")]
return "/dev/video0".into();
#[cfg(target_os = "macos")]
#[cfg(any(target_os = "macos", target_os = "windows"))]
return "0".into();
}

Expand Down Expand Up @@ -99,7 +99,7 @@ enum CaptureCommand {
Quit, // Return from (close) the thread
}

#[cfg(target_os = "macos")]
#[cfg(any(target_os = "macos", target_os = "windows"))]
fn verify_capture_ability(
camera_path: &str,
dimensions: Option<CameraDimensions>,
Expand Down Expand Up @@ -155,7 +155,7 @@ fn verify_capture_ability(
Ok(())
}

#[cfg(target_os = "macos")]
#[cfg(any(target_os = "macos", target_os = "windows"))]
fn video_capture(
camera_path: &str,
dimensions: Option<CameraDimensions>,
Expand Down
2 changes: 1 addition & 1 deletion src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -919,7 +919,7 @@ fn dissolve_subcommand(matches: &clap::ArgMatches) -> Result<(), CliError> {
}

fn attach_camera_subcommand(matches: &clap::ArgMatches) -> Result<(), CliError> {
#[cfg(not(any(target_os = "linux", target_os = "macos")))]
#[cfg(not(any(target_os = "linux", target_os = "macos", target_os = "windows")))]
return CliError::new("only Linux and Mac supported", 1);

if matches.values_of("id_prefix").is_some()
Expand Down

0 comments on commit 9b0b956

Please sign in to comment.