Skip to content

Commit

Permalink
remove use_freetype support for now
Browse files Browse the repository at this point in the history
Signed-off-by: Stephen Gutekanst <[email protected]>
  • Loading branch information
slimsag committed Aug 5, 2023
1 parent 39c733f commit d8cd623
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,12 @@ const std = @import("std");
const builtin = @import("builtin");
const glfw = @import("mach_glfw");
const sysaudio = @import("mach_sysaudio");
const gpu_dawn = @import("mach_gpu_dawn");
const gpu = @import("mach_gpu").Sdk(.{
.gpu_dawn = gpu_dawn,
});
const core = @import("mach_core");

pub var mach_glfw_import_path: []const u8 = "mach_core.mach_gpu.mach_gpu_dawn.mach_glfw";
pub var mach_ecs_import_path: []const u8 = "mach_ecs";
pub var mach_earcut_import_path: []const u8 = "mach_earcut";
pub var mach_basisu_import_path: []const u8 = "mach_basisu";
pub var harfbuzz_import_path: []const u8 = "mach_freetype.harfbuzz";
pub var mach_freetype_import_path: []const u8 = "mach_freetype";

var _module: ?*std.build.Module = null;

Expand Down Expand Up @@ -101,9 +95,7 @@ pub const App = struct {
install: *std.build.Step.InstallArtifact,
run: *std.build.Step.Run,
platform: core.App.Platform,

core: core.App,
use_freetype: ?[]const u8 = null,

pub fn init(
b: *std.Build,
Expand All @@ -116,20 +108,12 @@ pub const App = struct {
deps: ?[]const std.build.ModuleDependency = null,
res_dirs: ?[]const []const u8 = null,
watch_paths: ?[]const []const u8 = null,

/// If set, freetype will be linked and can be imported using this name.
// TODO(build-system): name is currently not used / always "freetype"
use_freetype: ?[]const u8 = null,
},
) !App {
var deps = std.ArrayList(std.build.ModuleDependency).init(b.allocator);
if (options.deps) |v| try deps.appendSlice(v);
try deps.append(.{ .name = "mach", .module = module(b, options.optimize, options.target) });
try deps.append(.{ .name = "sysaudio", .module = sysaudio.module(b, options.optimize, options.target) });
if (options.use_freetype) |name| {
const mach_freetype_dep = b.dependency(mach_freetype_import_path, .{ .target = options.target, .optimize = options.optimize });
try deps.append(.{ .name = name, .module = mach_freetype_dep.module("mach-freetype") });
}

core.mach_glfw_import_path = mach_glfw_import_path;
const app = try core.App.init(b, .{
Expand All @@ -150,7 +134,6 @@ pub const App = struct {
.install = app.install,
.run = app.run,
.platform = app.platform,
.use_freetype = options.use_freetype,
};
}

Expand All @@ -159,13 +142,7 @@ pub const App = struct {

// TODO: basisu support in wasm
if (app.platform != .web) {
const harfbuzz_dep = app.b.dependency(harfbuzz_import_path, .{
.target = app.compile.target,
.optimize = app.compile.optimize,
.enable_freetype = true,
});
app.compile.linkLibrary(@import("mach_basisu").lib(app.b, app.compile.optimize, app.compile.target));
app.compile.linkLibrary(harfbuzz_dep.artifact("harfbuzz"));
}
}
};
Expand Down

0 comments on commit d8cd623

Please sign in to comment.