diff --git a/v4l2-sys/build.rs b/v4l2-sys/build.rs index 8f09e8b..54df410 100644 --- a/v4l2-sys/build.rs +++ b/v4l2-sys/build.rs @@ -4,7 +4,10 @@ use std::env; use std::path::{Path, PathBuf}; fn main() { - let extra_include_paths = if cfg!(target_os = "freebsd") { + let extra_include_paths = if std::env::var("CARGO_CFG_TARGET_OS").unwrap() == "freebsd" { + // XXX: This path is wrong if the host OS != cross-compilation OS. If anything the host + // should simply set up the right path using `BINDGEN_EXTRA_CLANG_ARGS_`, allowing + // us to remove this workaround instead. assert!( Path::new("/usr/local/include/linux/videodev2.h").exists(), "Video4Linux `videodev2.h` UAPI header is required to generate bindings \