Skip to content

Commit 266957a

Browse files
authored
Merge pull request #858 from n-k/main
Fixed build for linux+vulkan when not using system vulkan SDK
2 parents 579dc8c + 9d55c01 commit 266957a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

llama-cpp-sys-2/build.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -658,6 +658,11 @@ fn main() {
658658
config.cxxflag("/FS");
659659
}
660660
TargetOs::Linux => {
661+
// If we are not using system provided vulkan SDK, add vulkan libs for linking
662+
if let Ok(vulkan_path) = env::var("VULKAN_SDK") {
663+
let vulkan_lib_path = Path::new(&vulkan_path).join("lib");
664+
println!("cargo:rustc-link-search={}", vulkan_lib_path.display());
665+
}
661666
println!("cargo:rustc-link-lib=vulkan");
662667
}
663668
_ => (),

0 commit comments

Comments
 (0)