From 7d31d9b57f7064f74cd8a098189d2f9248ef4dd5 Mon Sep 17 00:00:00 2001 From: Alessandro De Blasis Date: Tue, 24 Mar 2026 04:23:24 +0100 Subject: [PATCH] cmake: add import library to custom command OUTPUT Ninja requires all produced files to be listed as explicit outputs of custom commands. The zig build produces a .lib import library alongside the DLL, but it was not listed in the OUTPUT directive. This causes Ninja to fail with "missing and no known rule to make it" when IMPORTED_IMPLIB references the .lib file. Co-Authored-By: Claude Opus 4.6 (1M context) --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cae5bdba7..c596dad00 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -110,7 +110,7 @@ file(MAKE_DIRECTORY "${ZIG_OUT_DIR}/include") # Custom command: run zig build -Demit-lib-vt (produces both shared and static) add_custom_command( - OUTPUT "${GHOSTTY_VT_SHARED_LIBRARY}" "${GHOSTTY_VT_STATIC_LIBRARY}" + OUTPUT "${GHOSTTY_VT_SHARED_LIBRARY}" "${GHOSTTY_VT_STATIC_LIBRARY}" "${ZIG_OUT_DIR}/lib/${GHOSTTY_VT_IMPLIB}" COMMAND "${ZIG_EXECUTABLE}" build -Demit-lib-vt ${GHOSTTY_ZIG_BUILD_FLAGS} WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" COMMENT "Building libghostty-vt via zig build..."