Skip to content

Commit 1352475

Browse files
committed
Add support for CUDA FFI.
1 parent 86e6da6 commit 1352475

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

build.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,7 @@ fn main() {
645645
let statik = env::var("CARGO_FEATURE_STATIC").is_ok();
646646
let ffmpeg_major_version: u32 = env!("CARGO_PKG_VERSION_MAJOR").parse().unwrap();
647647

648-
let include_paths: Vec<PathBuf> = if env::var("CARGO_FEATURE_BUILD").is_ok() {
648+
let mut include_paths: Vec<PathBuf> = if env::var("CARGO_FEATURE_BUILD").is_ok() {
649649
println!(
650650
"cargo:rustc-link-search=native={}",
651651
search().join("lib").to_string_lossy()
@@ -742,6 +742,14 @@ fn main() {
742742
.include_paths
743743
};
744744

745+
include_paths.extend(
746+
pkg_config::Config::new()
747+
.statik(statik)
748+
.probe("cuda")
749+
.unwrap()
750+
.include_paths
751+
);
752+
745753
if statik && cfg!(target_os = "macos") {
746754
let frameworks = vec![
747755
"AppKit",
@@ -1236,6 +1244,7 @@ fn main() {
12361244
.header(search_include(&include_paths, "libavutil/hash.h"))
12371245
.header(search_include(&include_paths, "libavutil/hmac.h"))
12381246
.header(search_include(&include_paths, "libavutil/hwcontext.h"))
1247+
.header(search_include(&include_paths, "libavutil/hwcontext_cuda.h"))
12391248
.header(search_include(&include_paths, "libavutil/imgutils.h"))
12401249
.header(search_include(&include_paths, "libavutil/lfg.h"))
12411250
.header(search_include(&include_paths, "libavutil/log.h"))

0 commit comments

Comments
 (0)