Skip to content

Commit 469d9a9

Browse files
committed
Add support for CUDA FFI.
1 parent a13516c commit 469d9a9

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

build.rs

+10-1
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,7 @@ fn main() {
671671
let statik = env::var("CARGO_FEATURE_STATIC").is_ok();
672672
let ffmpeg_major_version: u32 = env!("CARGO_PKG_VERSION_MAJOR").parse().unwrap();
673673

674-
let include_paths: Vec<PathBuf> = if env::var("CARGO_FEATURE_BUILD").is_ok() {
674+
let mut include_paths: Vec<PathBuf> = if env::var("CARGO_FEATURE_BUILD").is_ok() {
675675
println!(
676676
"cargo:rustc-link-search=native={}",
677677
search().join("lib").to_string_lossy()
@@ -821,6 +821,14 @@ fn main() {
821821
.include_paths
822822
};
823823

824+
include_paths.extend(
825+
pkg_config::Config::new()
826+
.statik(statik)
827+
.probe("cuda")
828+
.unwrap()
829+
.include_paths
830+
);
831+
824832
if statik && cfg!(target_os = "macos") {
825833
let frameworks = vec![
826834
"AppKit",
@@ -1315,6 +1323,7 @@ fn main() {
13151323
.header(search_include(&include_paths, "libavutil/hash.h"))
13161324
.header(search_include(&include_paths, "libavutil/hmac.h"))
13171325
.header(search_include(&include_paths, "libavutil/hwcontext.h"))
1326+
.header(search_include(&include_paths, "libavutil/hwcontext_cuda.h"))
13181327
.header(search_include(&include_paths, "libavutil/imgutils.h"))
13191328
.header(search_include(&include_paths, "libavutil/lfg.h"))
13201329
.header(search_include(&include_paths, "libavutil/log.h"))

0 commit comments

Comments
 (0)