pkg/freetype, harfbuzz modules

This commit is contained in:
Mitchell Hashimoto
2023-10-01 16:57:45 -07:00
parent bc0f5c3012
commit 2237b43df0
6 changed files with 33 additions and 14 deletions

View File

@@ -5,8 +5,9 @@ pub fn build(b: *std.Build) !void {
const optimize = b.standardOptimizeOption(.{});
const libpng_enabled = b.option(bool, "enable-libpng", "Build libpng") orelse false;
const upstream = b.dependency("freetype", .{});
_ = b.addModule("freetype", .{ .source_file = .{ .path = "main.zig" } });
const upstream = b.dependency("freetype", .{});
const lib = b.addStaticLibrary(.{
.name = "freetype",
.target = target,

View File

@@ -8,6 +8,17 @@ pub fn build(b: *std.Build) !void {
const coretext_enabled = b.option(bool, "enable-coretext", "Build coretext") orelse false;
const freetype_enabled = b.option(bool, "enable-freetype", "Build freetype") orelse false;
const freetype = b.dependency("freetype", .{ .target = target, .optimize = optimize });
const macos = b.dependency("macos", .{ .target = target, .optimize = optimize });
_ = b.addModule("harfbuzz", .{
.source_file = .{ .path = "main.zig" },
.dependencies = &.{
.{ .name = "freetype", .module = freetype.module("freetype") },
.{ .name = "macos", .module = macos.module("macos") },
},
});
const upstream_root = "../../vendor/harfbuzz";
const lib = b.addStaticLibrary(.{

View File

@@ -3,6 +3,7 @@
.version = "2.13.2",
.dependencies = .{
.freetype = .{ .path = "../freetype" },
.macos = .{ .path = "../macos" },
.apple_sdk = .{ .path = "../apple-sdk" },
},
}

View File

@@ -1,6 +1,15 @@
const std = @import("std");
const builtin = @import("builtin");
pub fn build(b: *std.Build) !void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
_ = target;
_ = optimize;
_ = b.addModule("macos", .{ .source_file = .{ .path = "main.zig" } });
}
pub fn module(b: *std.Build) *std.build.Module {
return b.createModule(.{
.source_file = .{ .path = (comptime thisDir()) ++ "/main.zig" },