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.
pull/11977/head
Alessandro De Blasis 2026-03-30 18:56:09 +02:00
parent 0c765c7c58
commit 80e35af763
No known key found for this signature in database
GPG Key ID: EF3F4C75518B2F8D
1 changed files with 1 additions and 0 deletions

View File

@ -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