From 80e35af76362b3433a24ce5c0a7ffc73f5eaa59d Mon Sep 17 00:00:00 2001 From: Alessandro De Blasis Date: Mon, 30 Mar 2026 18:56:09 +0200 Subject: [PATCH] cmake: define GHOSTTY_STATIC for static library consumers The ghostty-vt-static target needs to propagate GHOSTTY_STATIC to consumers so that GHOSTTY_EXPORT resolves to nothing instead of __declspec(dllimport) on Windows. Without this, static linking fails with unresolved __imp_ghostty_* symbols. --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6a6cd216a..326f5b37a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -164,6 +164,7 @@ add_library(ghostty-vt-static STATIC IMPORTED GLOBAL) set_target_properties(ghostty-vt-static PROPERTIES IMPORTED_LOCATION "${GHOSTTY_VT_STATIC_LIBRARY}" INTERFACE_INCLUDE_DIRECTORIES "${ZIG_OUT_DIR}/include" + INTERFACE_COMPILE_DEFINITIONS "GHOSTTY_STATIC" ) if(WIN32) # On Windows, the Zig standard library uses NT API functions