mirror-ghostty/pkg
Mitchell Hashimoto 3d581eb92e
build: use linkLibC instead of linkLibCpp on MSVC targets
When compiling C++ files, Zig unconditionally passes -nostdinc++ and,
if link_libcpp is set, adds its bundled libc++/libc++abi include paths
as replacements (see Compilation.zig). On MSVC targets this conflicts
with the MSVC C++ runtime headers (vcruntime_typeinfo.h,
vcruntime_exception.h, etc.), causing compilation failures in SIMD
C++ code.

The fix is to use linkLibC instead of linkLibCpp on MSVC. Zig always
passes -nostdinc to strip default search paths, but LibCDirs.detect
re-adds the MSVC SDK include directories, which contain both C and
C++ standard library headers. This gives us proper access to MSVC's
own <optional>, <iterator>, <cstddef>, etc. without the libc++
conflicts.

For the package builds (highway, simdutf, utfcpp) this means
switching from linkLibCpp to linkLibC on MSVC. For SharedDeps and
GhosttyZig, linkLibC is already called separately, so we just skip
linkLibCpp.
2026-03-23 12:11:03 -07:00
..
afl++ pkg/afl++: remove @@ from run target since we use in-memory targets 2026-03-02 19:36:43 -08:00
android-ndk android: build improvements 2026-02-22 16:26:22 -06:00
apple-sdk zig-15: build binary builds 2025-10-03 07:10:41 -07:00
breakpad zig-15: build binary builds 2025-10-03 07:10:41 -07:00
dcimgui pkg/dcimgui: only add the OpenGL3 shutdown helper if backend enabled 2026-02-26 06:56:17 -08:00
fontconfig Fix LangSet.hasLang() to compare against FcLangEqual instead of FcTrue 2025-11-24 20:34:07 +00:00
freetype build: add -fPIC for musl targets in C++ dependencies 2026-01-07 06:55:40 -08:00
glslang build: add -fPIC for musl targets in C++ dependencies 2026-01-07 06:55:40 -08:00
gtk4-layer-shell gtk: address PR review feedback for quick-terminal-screen 2026-03-02 23:33:19 -06:00
harfbuzz set cluster level to match CoreText logic 2026-01-16 09:39:47 -05:00
highway build: use linkLibC instead of linkLibCpp on MSVC targets 2026-03-23 12:11:03 -07:00
libintl zig-15: build binary builds 2025-10-03 07:10:41 -07:00
libpng zig-15: build binary builds 2025-10-03 07:10:41 -07:00
libxml2 zig-15: build binary builds 2025-10-03 07:10:41 -07:00
macos Zig 0.15: zig build test macOS 2025-10-03 07:10:43 -07:00
oniguruma terminal: bound link regex search work with Oniguruma retry limits 2026-03-04 21:02:55 -08:00
opengl renderer: create explicit sampler state for custom shaders 2025-09-18 09:25:37 -07:00
sentry zig-15: build binary builds 2025-10-03 07:10:41 -07:00
simdutf build: use linkLibC instead of linkLibCpp on MSVC targets 2026-03-23 12:11:03 -07:00
spirv-cross build: add -fPIC for musl targets in C++ dependencies 2026-01-07 06:55:40 -08:00
utfcpp build: use linkLibC instead of linkLibCpp on MSVC targets 2026-03-23 12:11:03 -07:00
wuffs wuffs: protect against crafted images that cause overflows 2025-11-13 14:20:19 -06:00
zlib zig-15: build binary builds 2025-10-03 07:10:41 -07:00
README.md license: update copyright notices to include contributors 2025-06-10 10:20:26 -06:00

README.md

Packages

This folder contains packages written for and used by Ghostty that could potentially be useful for other projects. These are in-tree with Ghostty because I don't want to maintain them as separate projects (i.e. get dedicated issues, PRs, etc.). If you want to use them, you can copy and paste them into your project.

License

This license only applies to the contents of the pkg folder within the Ghostty project. This license does not apply to the rest of the Ghostty project.

Copyright © 2024 Mitchell Hashimoto, Ghostty contributors

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.