Skip to content

Commit 7711ae1

Browse files
committed
Fix Windows Vulkan library linking and add GUI Start Menu shortcut to NSIS installer configuration
1 parent 955844d commit 7711ae1

3 files changed

Lines changed: 14 additions & 4 deletions

File tree

CMakeLists.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -328,10 +328,10 @@ if(CARGO_EXECUTABLE)
328328

329329
# Install the Rust GUI binary
330330
if(WIN32)
331-
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/target/release/gpubench-gui.exe"
331+
install(PROGRAMS "${CMAKE_CURRENT_SOURCE_DIR}/target/release/gpubench-gui.exe"
332332
DESTINATION bin)
333333
else()
334-
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/target/release/gpubench-gui"
334+
install(PROGRAMS "${CMAKE_CURRENT_SOURCE_DIR}/target/release/gpubench-gui"
335335
DESTINATION bin)
336336
endif()
337337
else()
@@ -411,8 +411,9 @@ if(WIN32)
411411
set(CPACK_NSIS_URL_INFO_ABOUT "https://github.com/Soddentrough/GPUBench")
412412
set(CPACK_NSIS_CONTACT "https://github.com/Soddentrough/GPUBench/issues")
413413
set(CPACK_NSIS_MENU_LINKS
414-
"RunAllBenchmarks.bat" "Run All Benchmarks"
414+
"bin/gpubench-gui.exe" "GPUBench"
415415
"bin/gpubench.exe" "GPUBench (CLI)"
416+
"RunAllBenchmarks.bat" "Run All Benchmarks"
416417
"https://github.com/Soddentrough/GPUBench" "GPUBench Website"
417418
)
418419

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gpubench-sys/build.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,15 @@ fn main() {
77
println!("cargo:rustc-link-search=native={}/build/Release", dst.display());
88
println!("cargo:rustc-link-search=native={}/build/Debug", dst.display());
99
println!("cargo:rustc-link-lib=static=gpubench_lib");
10-
println!("cargo:rustc-link-lib=vulkan");
10+
let target_os = std::env::var("CARGO_CFG_TARGET_OS").unwrap_or_default();
11+
if target_os == "windows" {
12+
println!("cargo:rustc-link-lib=vulkan-1");
13+
if let Ok(sdk) = std::env::var("VULKAN_SDK") {
14+
println!("cargo:rustc-link-search=native={}/Lib", sdk);
15+
}
16+
} else {
17+
println!("cargo:rustc-link-lib=vulkan");
18+
}
1119

1220
cxx_build::bridge("src/lib.rs")
1321
.file("src/bridge.cpp") // We'll create this to bridge complex types if needed

0 commit comments

Comments
 (0)