From a7eb40580a7864edd76d2e3b9ec1de4a6ed0d110 Mon Sep 17 00:00:00 2001 From: Morrison Liu Date: Tue, 21 Jul 2026 21:32:10 +0800 Subject: [PATCH] Windows: emit vulkan-1 (not vulkan) in the static-link manifest cmake/transcribe-install.cmake records `vulkan` into transcribe-link.json's system_libs on every OS, but Windows' LunarG SDK ships the import lib as `vulkan-1.lib`. A consumer that reconstructs the link line from the manifest (the Rust -sys crate, the link_smoke C consumer) then asks MSVC for a nonexistent `vulkan.lib` and dies with LNK1181: cannot open input file 'vulkan.lib'. The in-tree ggml-vulkan target links fine because it uses find_package(Vulkan) -> Vulkan::Vulkan (an absolute path); only the hand-written manifest reconstruction hardcodes the Unix basename. Emit `vulkan-1` under if(WIN32) and `vulkan` otherwise, matching how whisper-rs-sys resolves the same import lib. Non-Windows output is byte identical. --- cmake/transcribe-install.cmake | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/cmake/transcribe-install.cmake b/cmake/transcribe-install.cmake index 586799cb..e266ca6a 100644 --- a/cmake/transcribe-install.cmake +++ b/cmake/transcribe-install.cmake @@ -135,7 +135,18 @@ if(NOT TRANSCRIBE_BUILD_SHARED) list(APPEND _frameworks Accelerate) endif() if("vulkan" IN_LIST _kinds) - list(APPEND _system_libs vulkan) + # The Vulkan import library's basename is platform-specific: Windows' + # LunarG SDK ships `vulkan-1.lib` (the import lib for the + # driver-installed vulkan-1.dll loader); every other platform links + # `libvulkan`. Emit the right name per-OS so a non-CMake consumer + # reconstructing the link line from this manifest resolves it — a bare + # `vulkan` becomes `vulkan.lib` on MSVC, which the SDK does not provide, + # so the link dies with LNK1181. + if(WIN32) + list(APPEND _system_libs vulkan-1) + else() + list(APPEND _system_libs vulkan) + endif() endif() if(_frameworks) list(REMOVE_DUPLICATES _frameworks)