Skip to content

Commit

Permalink
Add support for CUDA FFI.
Browse files Browse the repository at this point in the history
  • Loading branch information
hgaiser committed Feb 29, 2024
1 parent 86e6da6 commit 1352475
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,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<PathBuf> = if env::var("CARGO_FEATURE_BUILD").is_ok() {
let mut include_paths: Vec<PathBuf> = if env::var("CARGO_FEATURE_BUILD").is_ok() {
println!(
"cargo:rustc-link-search=native={}",
search().join("lib").to_string_lossy()
Expand Down Expand Up @@ -742,6 +742,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",
Expand Down Expand Up @@ -1236,6 +1244,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"))
Expand Down

0 comments on commit 1352475

Please sign in to comment.