aboutsummaryrefslogtreecommitdiff
path: root/vendor/libghostty-vt/pkg/highway/build.zig
diff options
context:
space:
mode:
authorOgulcan Celik <ogulcancelik@gmail.com>2026-05-07 18:29:21 +0300
committerOgulcan Celik <ogulcancelik@gmail.com>2026-05-07 18:29:21 +0300
commitdcfe11a7588fcd42471159453810abc9b7720a57 (patch)
treec32a77266028e73ca2382b96c96f8438a5fcd621 /vendor/libghostty-vt/pkg/highway/build.zig
parent2dfed860103c4e4505ac7f25def9fe37da1e1e6a (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/pkg/highway/build.zig')
-rw-r--r--vendor/libghostty-vt/pkg/highway/build.zig50
1 files changed, 20 insertions, 30 deletions
diff --git a/vendor/libghostty-vt/pkg/highway/build.zig b/vendor/libghostty-vt/pkg/highway/build.zig
index 49656b93..0ac77612 100644
--- a/vendor/libghostty-vt/pkg/highway/build.zig
+++ b/vendor/libghostty-vt/pkg/highway/build.zig
@@ -7,7 +7,7 @@ pub fn build(b: *std.Build) !void {
const upstream_ = b.lazyDependency("highway", .{});
const module = b.addModule("highway", .{
- .root_source_file = b.path("main.zig"),
+ .root_source_file = b.path("src/main.zig"),
.target = target,
.optimize = optimize,
});
@@ -15,30 +15,23 @@ pub fn build(b: *std.Build) !void {
const lib = b.addLibrary(.{
.name = "highway",
.root_module = b.createModule(.{
+ .root_source_file = b.path("src/detect.zig"),
.target = target,
.optimize = optimize,
}),
.linkage = .static,
});
+
+ // Our highway package is free of libc at runtime (uses no symbols)
+ // but does require libc headers at compile time.
lib.linkLibC();
- // On MSVC, we must not use linkLibCpp because Zig unconditionally
- // passes -nostdinc++ and then adds its bundled libc++/libc++abi
- // include paths, which conflict with MSVC's own C++ runtime headers.
- // The MSVC SDK include directories (added via linkLibC) contain
- // both C and C++ headers, so linkLibCpp is not needed.
- if (target.result.abi != .msvc) {
- lib.linkLibCpp();
- }
+
+ lib.addIncludePath(b.path("src/cpp"));
if (upstream_) |upstream| {
lib.addIncludePath(upstream.path(""));
module.addIncludePath(upstream.path(""));
}
- if (target.result.os.tag.isDarwin()) {
- const apple_sdk = @import("apple_sdk");
- try apple_sdk.addPaths(b, lib);
- }
-
if (target.result.abi.isAndroid()) {
const android_ndk = @import("android_ndk");
try android_ndk.addPaths(b, lib);
@@ -47,6 +40,10 @@ pub fn build(b: *std.Build) !void {
var flags: std.ArrayList([]const u8) = .empty;
defer flags.deinit(b.allocator);
try flags.appendSlice(b.allocator, &.{
+ // Highway can avoid libc++ entirely as long as all users compile
+ // against the headers with the same define.
+ "-DHWY_NO_LIBCXX",
+
// Avoid changing binaries based on the current time and date.
"-Wno-builtin-macro-redefined",
"-D__DATE__=\"redacted\"",
@@ -86,8 +83,9 @@ pub fn build(b: *std.Build) !void {
"-fno-sanitize-trap=undefined",
});
- if (target.result.os.tag == .freebsd or target.result.abi == .musl) {
+ if (target.result.os.tag == .freebsd or target.result.os.tag == .linux) {
try flags.append(b.allocator, "-fPIC");
+ lib.root_module.pic = true;
}
if (target.result.os.tag != .windows) {
@@ -97,21 +95,13 @@ pub fn build(b: *std.Build) !void {
});
}
- lib.addCSourceFiles(.{ .flags = flags.items, .files = &.{"bridge.cpp"} });
+ lib.addCSourceFiles(.{ .flags = flags.items, .files = &.{
+ "src/cpp/abort.cc",
+ "src/cpp/per_target.cc",
+ "src/cpp/targets.cpp",
+ } });
+
if (upstream_) |upstream| {
- lib.addCSourceFiles(.{
- .root = upstream.path(""),
- .flags = flags.items,
- .files = &.{
- "hwy/abort.cc",
- "hwy/aligned_allocator.cc",
- "hwy/nanobenchmark.cc",
- "hwy/per_target.cc",
- "hwy/print.cc",
- "hwy/targets.cc",
- "hwy/timer.cc",
- },
- });
lib.installHeadersDirectory(
upstream.path("hwy"),
"hwy",
@@ -125,7 +115,7 @@ pub fn build(b: *std.Build) !void {
const test_exe = b.addTest(.{
.name = "test",
.root_module = b.createModule(.{
- .root_source_file = b.path("main.zig"),
+ .root_source_file = b.path("src/main.zig"),
.target = target,
.optimize = optimize,
}),