mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-04-21 23:05:20 +00:00
move simdutf to a pkg
This commit is contained in:
62
pkg/simdutf/build.zig
Normal file
62
pkg/simdutf/build.zig
Normal file
@@ -0,0 +1,62 @@
|
||||
const std = @import("std");
|
||||
|
||||
pub fn build(b: *std.Build) !void {
|
||||
const target = b.standardTargetOptions(.{});
|
||||
const optimize = b.standardOptimizeOption(.{});
|
||||
|
||||
const module = b.addModule("simdutf", .{
|
||||
.root_source_file = .{ .path = "main.zig" },
|
||||
.target = target,
|
||||
.optimize = optimize,
|
||||
});
|
||||
|
||||
const lib = b.addStaticLibrary(.{
|
||||
.name = "simdutf",
|
||||
.target = target,
|
||||
.optimize = optimize,
|
||||
});
|
||||
lib.linkLibCpp();
|
||||
lib.addIncludePath(.{ .path = "vendor" });
|
||||
module.addIncludePath(.{ .path = "vendor" });
|
||||
|
||||
if (target.result.isDarwin()) {
|
||||
const apple_sdk = @import("apple_sdk");
|
||||
try apple_sdk.addPaths(b, &lib.root_module);
|
||||
try apple_sdk.addPaths(b, module);
|
||||
}
|
||||
|
||||
var flags = std.ArrayList([]const u8).init(b.allocator);
|
||||
defer flags.deinit();
|
||||
try flags.appendSlice(&.{});
|
||||
|
||||
lib.addCSourceFiles(.{
|
||||
.flags = flags.items,
|
||||
.files = &.{
|
||||
"vendor/simdutf.cpp",
|
||||
},
|
||||
});
|
||||
lib.installHeadersDirectoryOptions(.{
|
||||
.source_dir = .{ .path = "vendor" },
|
||||
.install_dir = .header,
|
||||
.install_subdir = "",
|
||||
.include_extensions = &.{".h"},
|
||||
});
|
||||
|
||||
b.installArtifact(lib);
|
||||
|
||||
{
|
||||
const test_exe = b.addTest(.{
|
||||
.name = "test",
|
||||
.root_source_file = .{ .path = "main.zig" },
|
||||
.target = target,
|
||||
.optimize = optimize,
|
||||
});
|
||||
test_exe.linkLibrary(lib);
|
||||
|
||||
var it = module.import_table.iterator();
|
||||
while (it.next()) |entry| test_exe.root_module.addImport(entry.key_ptr.*, entry.value_ptr.*);
|
||||
const tests_run = b.addRunArtifact(test_exe);
|
||||
const test_step = b.step("test", "Run tests");
|
||||
test_step.dependOn(&tests_run.step);
|
||||
}
|
||||
}
|
||||
8
pkg/simdutf/build.zig.zon
Normal file
8
pkg/simdutf/build.zig.zon
Normal file
@@ -0,0 +1,8 @@
|
||||
.{
|
||||
.name = "simdutf",
|
||||
.version = "4.0.9",
|
||||
.paths = .{""},
|
||||
.dependencies = .{
|
||||
.apple_sdk = .{ .path = "../apple-sdk" },
|
||||
},
|
||||
}
|
||||
0
pkg/simdutf/main.zig
Normal file
0
pkg/simdutf/main.zig
Normal file
33245
pkg/simdutf/vendor/simdutf.cpp
vendored
Normal file
33245
pkg/simdutf/vendor/simdutf.cpp
vendored
Normal file
File diff suppressed because it is too large
Load Diff
3437
pkg/simdutf/vendor/simdutf.h
vendored
Normal file
3437
pkg/simdutf/vendor/simdutf.h
vendored
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user