Skip to content

Commit fa87e7d

Browse files
committed
Add FFMPEG_VULKAN_SDK_INCLUDE environment variable to indicate vulkan include folder for vulkan build
1 parent 586063a commit fa87e7d

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ffmpeg-sys-next"
3-
version = "7.1.1"
3+
version = "7.1.2"
44
build = "build.rs"
55
links = "ffmpeg"
66

build.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -648,6 +648,20 @@ fn build(sysroot: Option<&str>) -> io::Result<()> {
648648
}
649649

650650
enable!(configure, "BUILD_VULKAN", "vulkan");
651+
if env::var("CARGO_FEATURE_BUILD_VULKAN").is_ok() {
652+
match env::var_os("FFMPEG_VULKAN_SDK_INCLUDE") {
653+
Some(path) => {
654+
let mut flags = OsString::from("--extra-cflags=-I");
655+
flags.push(path);
656+
configure.arg(flags);
657+
}
658+
None => {
659+
eprintln!("Warning: missing environment variable FFMPEG_VULKAN_SDK_INCLUDE, compilation may fail");
660+
eprintln!("FFMPEG_VULKAN_SDK_INCLUDE should be a path to vulkan SDK (>= 1.3.277) include folder");
661+
eprintln!("Please do not include space in path");
662+
}
663+
}
664+
}
651665

652666
// other external libraries
653667
enable!(configure, "BUILD_LIB_DRM", "libdrm");

0 commit comments

Comments
 (0)