feat(gui): base project
This commit is contained in:
44
build.zig
44
build.zig
@@ -10,10 +10,20 @@ pub fn build(b: *std.Build) void {
|
||||
.optimize = optimize,
|
||||
});
|
||||
const console_exe = b.addExecutable(.{
|
||||
.name = "FileTime3",
|
||||
.name = "ftime",
|
||||
.root_module = console_exe_mod,
|
||||
});
|
||||
|
||||
const gui_exe_mod = b.createModule(.{
|
||||
.root_source_file = b.path("src/gui_main.zig"),
|
||||
.target = target,
|
||||
.optimize = optimize,
|
||||
});
|
||||
const gui_exe = b.addExecutable(.{
|
||||
.name = "filetime",
|
||||
.root_module = gui_exe_mod,
|
||||
});
|
||||
|
||||
const vaxis = b.dependency("vaxis", .{
|
||||
.target = target,
|
||||
.optimize = optimize,
|
||||
@@ -22,22 +32,38 @@ pub fn build(b: *std.Build) void {
|
||||
console_exe.root_module.addImport("vaxis", vaxis.module("vaxis"));
|
||||
b.installArtifact(console_exe);
|
||||
|
||||
const dvui = b.dependency("dvui", .{
|
||||
.target = target,
|
||||
.optimize = optimize,
|
||||
.backend = .raylib,
|
||||
});
|
||||
|
||||
gui_exe.root_module.addImport("dvui", dvui.module("dvui_raylib"));
|
||||
b.installArtifact(gui_exe);
|
||||
|
||||
const run_console_cmd = b.addRunArtifact(console_exe);
|
||||
run_console_cmd.step.dependOn(b.getInstallStep());
|
||||
|
||||
const run_gui_cmd = b.addRunArtifact(gui_exe);
|
||||
run_gui_cmd.step.dependOn(b.getInstallStep());
|
||||
|
||||
if (b.args) |args| {
|
||||
run_console_cmd.addArgs(args);
|
||||
run_gui_cmd.addArgs(args);
|
||||
}
|
||||
|
||||
const run_console_step = b.step("run", "Run the console app");
|
||||
const run_console_step = b.step("run:console", "Run the console app");
|
||||
run_console_step.dependOn(&run_console_cmd.step);
|
||||
|
||||
const console_unit_tests = b.addTest(.{
|
||||
.root_module = console_exe_mod,
|
||||
});
|
||||
const run_gui_step = b.step("run:gui", "Run the gui app");
|
||||
run_gui_step.dependOn(&run_gui_cmd.step);
|
||||
|
||||
const run_console_unit_tests = b.addRunArtifact(console_unit_tests);
|
||||
|
||||
const test_step = b.step("test", "Run unit console tests");
|
||||
test_step.dependOn(&run_console_unit_tests.step);
|
||||
// const console_unit_tests = b.addTest(.{
|
||||
// .root_module = console_exe_mod,
|
||||
// });
|
||||
//
|
||||
// const run_console_unit_tests = b.addRunArtifact(console_unit_tests);
|
||||
//
|
||||
// const test_step = b.step("test", "Run unit console tests");
|
||||
// test_step.dependOn(&run_console_unit_tests.step);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user