diff --git a/build.rs b/build.rs index eb81e0c..6df4244 100644 --- a/build.rs +++ b/build.rs @@ -671,7 +671,7 @@ fn main() { let statik = env::var("CARGO_FEATURE_STATIC").is_ok(); let ffmpeg_major_version: u32 = env!("CARGO_PKG_VERSION_MAJOR").parse().unwrap(); - let include_paths: Vec = if env::var("CARGO_FEATURE_BUILD").is_ok() { + let mut include_paths: Vec = if env::var("CARGO_FEATURE_BUILD").is_ok() { println!( "cargo:rustc-link-search=native={}", search().join("lib").to_string_lossy() @@ -821,6 +821,14 @@ fn main() { .include_paths }; + include_paths.extend( + pkg_config::Config::new() + .statik(statik) + .probe("cuda") + .unwrap() + .include_paths + ); + if statik && cfg!(target_os = "macos") { let frameworks = vec![ "AppKit", @@ -1315,6 +1323,7 @@ fn main() { .header(search_include(&include_paths, "libavutil/hash.h")) .header(search_include(&include_paths, "libavutil/hmac.h")) .header(search_include(&include_paths, "libavutil/hwcontext.h")) + .header(search_include(&include_paths, "libavutil/hwcontext_cuda.h")) .header(search_include(&include_paths, "libavutil/imgutils.h")) .header(search_include(&include_paths, "libavutil/lfg.h")) .header(search_include(&include_paths, "libavutil/log.h"))