diff --git a/Cargo.toml b/Cargo.toml index 5d6b83c..7d73488 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,11 +4,14 @@ version = "0.1.0" authors = ["Ruben van de Ven "] edition = "2018" -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[features] +build-binary = ["v4l"] [[bin]] name = "visual_haarcascades" path = "src/main.rs" +required-features = ["build-binary"] # https://stackoverflow.com/a/46017284 [[bin]] name = "visual_haarcascades_test" @@ -22,7 +25,7 @@ crate-type = ["dylib"] [dependencies] nannou = "0.14" # clang-sys = "0.29.3" -v4l = {version = "0.5.1", features = ["libv4l"]} +v4l = {version = "0.5.1", features = ["libv4l"], optional = true} image = "0.23" log = "0.4" xml-rs = "0.8.3" diff --git a/src/test.rs b/src/test.rs index c532c96..61d5fb5 100644 --- a/src/test.rs +++ b/src/test.rs @@ -5,7 +5,6 @@ extern crate stopwatch; use stopwatch::{Stopwatch}; use simplelog::*; -use v4l::{Buffer, CaptureDevice, MappedBufferStream}; use image; mod visualhaar; @@ -13,8 +12,6 @@ mod heatmap; // use std::fs::File; -static mut CAMERA: Option = None; - fn main() { CombinedLogger::init( vec![