mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-04-20 00:18:53 +03:00
38 lines
1.0 KiB
Zig
38 lines
1.0 KiB
Zig
const std = @import("std");
|
|
|
|
pub fn build(b: *std.Build) !void {
|
|
const target = b.standardTargetOptions(.{});
|
|
const optimize = b.standardOptimizeOption(.{});
|
|
|
|
const module = b.addModule("utf8proc", .{ .root_source_file = .{ .path = "main.zig" } });
|
|
|
|
const upstream = b.dependency("utf8proc", .{});
|
|
const lib = b.addStaticLibrary(.{
|
|
.name = "utf8proc",
|
|
.target = target,
|
|
.optimize = optimize,
|
|
});
|
|
lib.linkLibC();
|
|
|
|
lib.addIncludePath(upstream.path(""));
|
|
module.addIncludePath(upstream.path(""));
|
|
|
|
var flags = std.ArrayList([]const u8).init(b.allocator);
|
|
try flags.append("-DUTF8PROC_EXPORTS");
|
|
defer flags.deinit();
|
|
lib.addCSourceFiles(.{
|
|
.root = upstream.path(""),
|
|
.files = &.{"utf8proc.c"},
|
|
.flags = flags.items,
|
|
});
|
|
|
|
lib.installHeadersDirectoryOptions(.{
|
|
.source_dir = upstream.path(""),
|
|
.install_dir = .header,
|
|
.install_subdir = "",
|
|
.include_extensions = &.{".h"},
|
|
});
|
|
|
|
b.installArtifact(lib);
|
|
}
|