aboutsummaryrefslogtreecommitdiff
path: root/vendor/libghostty-vt/dist
diff options
context:
space:
mode:
authorCan Celik <ogulcancelik@gmail.com>2026-04-04 19:22:04 +0300
committerCan Celik <ogulcancelik@gmail.com>2026-04-05 01:23:06 +0300
commit41dd733ca7123c9ac4bfc6c781697a660e95b052 (patch)
tree3fc91815ca139ef2e0b281bba0abda4ef15175f4 /vendor/libghostty-vt/dist
parent55c138263e190a1e79d4b997bfb9397306c0ec1f (diff)
feat: finish ghostty pane backend integration
Diffstat (limited to 'vendor/libghostty-vt/dist')
-rw-r--r--vendor/libghostty-vt/dist/cmake/README.md67
-rw-r--r--vendor/libghostty-vt/dist/cmake/ghostty-vt-config.cmake.in65
2 files changed, 132 insertions, 0 deletions
diff --git a/vendor/libghostty-vt/dist/cmake/README.md b/vendor/libghostty-vt/dist/cmake/README.md
new file mode 100644
index 00000000..ed8b8645
--- /dev/null
+++ b/vendor/libghostty-vt/dist/cmake/README.md
@@ -0,0 +1,67 @@
+# CMake Support for libghostty-vt
+
+The top-level `CMakeLists.txt` wraps the Zig build system so that CMake
+projects can consume libghostty-vt without invoking `zig build` manually.
+Running `cmake --build` triggers `zig build -Demit-lib-vt` automatically.
+
+This means downstream projects do require a working Zig compiler on
+`PATH` to build, but don't need to know any Zig-specific details.
+
+## Using FetchContent (recommended)
+
+Add the following to your project's `CMakeLists.txt`:
+
+```cmake
+include(FetchContent)
+FetchContent_Declare(ghostty
+ GIT_REPOSITORY https://github.com/ghostty-org/ghostty.git
+ GIT_TAG main
+)
+FetchContent_MakeAvailable(ghostty)
+
+add_executable(myapp main.c)
+target_link_libraries(myapp PRIVATE ghostty-vt)
+```
+
+This fetches the Ghostty source, builds libghostty-vt via Zig during your
+CMake build, and links it into your target. Headers are added to the
+include path automatically.
+
+### Using a local checkout
+
+If you already have the Ghostty source checked out, skip the download by
+pointing CMake at it:
+
+```shell-session
+cmake -B build -DFETCHCONTENT_SOURCE_DIR_GHOSTTY=/path/to/ghostty
+cmake --build build
+```
+
+## Using find_package (install-based)
+
+Build and install libghostty-vt first:
+
+```shell-session
+cd /path/to/ghostty
+cmake -B build
+cmake --build build
+cmake --install build --prefix /usr/local
+```
+
+Then in your project:
+
+```cmake
+find_package(ghostty-vt REQUIRED)
+
+add_executable(myapp main.c)
+target_link_libraries(myapp PRIVATE ghostty-vt::ghostty-vt)
+```
+
+## Files
+
+- `ghostty-vt-config.cmake.in` — template for the CMake package config
+ file installed alongside the library, enabling `find_package()` support.
+
+## Example
+
+See `example/c-vt-cmake/` for a complete working example.
diff --git a/vendor/libghostty-vt/dist/cmake/ghostty-vt-config.cmake.in b/vendor/libghostty-vt/dist/cmake/ghostty-vt-config.cmake.in
new file mode 100644
index 00000000..8e1d7572
--- /dev/null
+++ b/vendor/libghostty-vt/dist/cmake/ghostty-vt-config.cmake.in
@@ -0,0 +1,65 @@
+@PACKAGE_INIT@
+
+include(CMakeFindDependencyMacro)
+
+set(_ghostty_vt_libdir "${PACKAGE_PREFIX_DIR}/@CMAKE_INSTALL_LIBDIR@")
+
+# Shared library target
+if(NOT TARGET ghostty-vt::ghostty-vt)
+ add_library(ghostty-vt::ghostty-vt SHARED IMPORTED)
+
+ if(WIN32)
+ set(_ghostty_vt_shared_location "${PACKAGE_PREFIX_DIR}/@CMAKE_INSTALL_BINDIR@/@GHOSTTY_VT_REALNAME@")
+ else()
+ set(_ghostty_vt_shared_location "${_ghostty_vt_libdir}/@GHOSTTY_VT_REALNAME@")
+ endif()
+
+ set_target_properties(ghostty-vt::ghostty-vt PROPERTIES
+ IMPORTED_LOCATION "${_ghostty_vt_shared_location}"
+ INTERFACE_INCLUDE_DIRECTORIES "${PACKAGE_PREFIX_DIR}/@CMAKE_INSTALL_INCLUDEDIR@"
+ )
+ unset(_ghostty_vt_shared_location)
+
+ if(APPLE)
+ set_target_properties(ghostty-vt::ghostty-vt PROPERTIES
+ IMPORTED_SONAME "@rpath/@GHOSTTY_VT_SONAME@"
+ INTERFACE_LINK_DIRECTORIES "${_ghostty_vt_libdir}"
+ )
+ # Ensure consumers can find the @rpath dylib at runtime
+ set_property(TARGET ghostty-vt::ghostty-vt APPEND PROPERTY
+ INTERFACE_LINK_OPTIONS "LINKER:-rpath,${_ghostty_vt_libdir}"
+ )
+ elseif(WIN32)
+ set_target_properties(ghostty-vt::ghostty-vt PROPERTIES
+ IMPORTED_IMPLIB "${_ghostty_vt_libdir}/@GHOSTTY_VT_IMPLIB@"
+ )
+ else()
+ set_target_properties(ghostty-vt::ghostty-vt PROPERTIES
+ IMPORTED_SONAME "@GHOSTTY_VT_SONAME@"
+ )
+ endif()
+endif()
+
+# Static library target
+#
+# Consumers must link transitive dependencies themselves. By default (with
+# SIMD enabled): libc, libc++ (or libstdc++ on Linux), highway, and
+# simdutf. Building with -Dsimd=false removes the C++ / highway / simdutf
+# dependencies.
+if(NOT TARGET ghostty-vt::ghostty-vt-static)
+ add_library(ghostty-vt::ghostty-vt-static STATIC IMPORTED)
+
+ set_target_properties(ghostty-vt::ghostty-vt-static PROPERTIES
+ IMPORTED_LOCATION "${_ghostty_vt_libdir}/@GHOSTTY_VT_STATIC_REALNAME@"
+ INTERFACE_INCLUDE_DIRECTORIES "${PACKAGE_PREFIX_DIR}/@CMAKE_INSTALL_INCLUDEDIR@"
+ )
+ if(WIN32)
+ set_target_properties(ghostty-vt::ghostty-vt-static PROPERTIES
+ INTERFACE_LINK_LIBRARIES "ntdll;kernel32"
+ )
+ endif()
+endif()
+
+unset(_ghostty_vt_libdir)
+
+check_required_components(ghostty-vt)