mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-04-19 14:00:29 +00:00
pkg/pixman, utf8proc
This commit is contained in:
@@ -1,55 +0,0 @@
|
||||
const std = @import("std");
|
||||
|
||||
/// Directories with our includes.
|
||||
const root = thisDir() ++ "../../../vendor/utf8proc/";
|
||||
const include_path = root;
|
||||
|
||||
pub const include_paths = .{include_path};
|
||||
|
||||
pub fn module(b: *std.Build) *std.build.Module {
|
||||
return b.createModule(.{
|
||||
.source_file = .{ .path = (comptime thisDir()) ++ "/main.zig" },
|
||||
});
|
||||
}
|
||||
|
||||
fn thisDir() []const u8 {
|
||||
return std.fs.path.dirname(@src().file) orelse ".";
|
||||
}
|
||||
|
||||
pub fn link(b: *std.Build, step: *std.build.LibExeObjStep) !*std.build.LibExeObjStep {
|
||||
const lib = try buildLib(b, step);
|
||||
step.linkLibrary(lib);
|
||||
step.addIncludePath(.{ .path = include_path });
|
||||
return lib;
|
||||
}
|
||||
|
||||
pub fn buildLib(
|
||||
b: *std.Build,
|
||||
step: *std.build.LibExeObjStep,
|
||||
) !*std.build.LibExeObjStep {
|
||||
const lib = b.addStaticLibrary(.{
|
||||
.name = "utf8proc",
|
||||
.target = step.target,
|
||||
.optimize = step.optimize,
|
||||
});
|
||||
|
||||
// Include
|
||||
lib.addIncludePath(.{ .path = include_path });
|
||||
|
||||
// Link
|
||||
lib.linkLibC();
|
||||
|
||||
// Compile
|
||||
var flags = std.ArrayList([]const u8).init(b.allocator);
|
||||
try flags.append("-DUTF8PROC_EXPORTS");
|
||||
defer flags.deinit();
|
||||
|
||||
// C files
|
||||
lib.addCSourceFiles(srcs, flags.items);
|
||||
|
||||
return lib;
|
||||
}
|
||||
|
||||
const srcs = &.{
|
||||
root ++ "utf8proc.c",
|
||||
};
|
||||
@@ -4,8 +4,9 @@ pub fn build(b: *std.Build) !void {
|
||||
const target = b.standardTargetOptions(.{});
|
||||
const optimize = b.standardOptimizeOption(.{});
|
||||
|
||||
const upstream = b.dependency("utf8proc", .{});
|
||||
_ = b.addModule("utf8proc", .{ .source_file = .{ .path = "main.zig" } });
|
||||
|
||||
const upstream = b.dependency("utf8proc", .{});
|
||||
const lib = b.addStaticLibrary(.{
|
||||
.name = "utf8proc",
|
||||
.target = target,
|
||||
|
||||
Reference in New Issue
Block a user