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 Apr 11, 2024
1 parent 3a00222 commit c684bec
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 @@ -646,7 +646,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 @@ -766,6 +766,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 @@ -1260,6 +1268,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 c684bec

Please sign in to comment.