diff options
| author | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-05-07 18:29:21 +0300 |
|---|---|---|
| committer | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-05-07 18:29:21 +0300 |
| commit | dcfe11a7588fcd42471159453810abc9b7720a57 (patch) | |
| tree | c32a77266028e73ca2382b96c96f8438a5fcd621 /vendor/libghostty-vt/dist/cmake/README.md | |
| parent | 2dfed860103c4e4505ac7f25def9fe37da1e1e6a (diff) | |
build: update libghostty-vt vendor
vendor ghostty 063ac3e and remove the musl libc++ link workaround.
expose the new selection formatter and hyperlink uri apis for follow-up rendering work.
add manual artifact validation for static linux builds.
Diffstat (limited to 'vendor/libghostty-vt/dist/cmake/README.md')
| -rw-r--r-- | vendor/libghostty-vt/dist/cmake/README.md | 45 |
1 files changed, 40 insertions, 5 deletions
diff --git a/vendor/libghostty-vt/dist/cmake/README.md b/vendor/libghostty-vt/dist/cmake/README.md index ed8b8645..10cd477c 100644 --- a/vendor/libghostty-vt/dist/cmake/README.md +++ b/vendor/libghostty-vt/dist/cmake/README.md @@ -57,11 +57,46 @@ add_executable(myapp main.c) target_link_libraries(myapp PRIVATE ghostty-vt::ghostty-vt) ``` -## Files +## Cross-compilation -- `ghostty-vt-config.cmake.in` — template for the CMake package config - file installed alongside the library, enabling `find_package()` support. +For cross-compiling to a different Zig target triple, use +`ghostty_vt_add_target()` after `FetchContent_MakeAvailable`: -## Example +```cmake +FetchContent_MakeAvailable(ghostty) +ghostty_vt_add_target(NAME linux-amd64 ZIG_TARGET x86_64-linux-gnu) + +add_executable(myapp main.c) +target_link_libraries(myapp PRIVATE ghostty-vt-static-linux-amd64) +``` + +### Using zig cc as the C/CXX compiler + +When cross-compiling, the host C compiler can't link binaries for the +target platform. `GhosttyZigCompiler.cmake` provides +`ghostty_zig_compiler()` to set up `zig cc` as the C/CXX compiler for +the cross target. It creates wrapper scripts (shell on Unix, `.cmd` on +Windows) and configures `CMAKE_C_COMPILER`, `CMAKE_CXX_COMPILER`, and +`CMAKE_SYSTEM_NAME`. + +The module is self-contained — copy it into your project (e.g. to +`cmake/`) and include it directly. It cannot be consumed via +FetchContent because it must run before `project()`, but +`FetchContent_MakeAvailable` triggers `project()` internally: + +```cmake +cmake_minimum_required(VERSION 3.19) + +include(cmake/GhosttyZigCompiler.cmake) +ghostty_zig_compiler(ZIG_TARGET x86_64-linux-gnu) + +project(myapp LANGUAGES C CXX) + +FetchContent_MakeAvailable(ghostty) +ghostty_vt_add_target(NAME linux-amd64 ZIG_TARGET x86_64-linux-gnu) + +add_executable(myapp main.c) +target_link_libraries(myapp PRIVATE ghostty-vt-static-linux-amd64) +``` -See `example/c-vt-cmake/` for a complete working example. +See `example/c-vt-cmake-cross/` for a complete working example. |
