jetzig/cli/build.zig
Bob Farrell d3a3582136 Implement init command, get rid of old init script/artifacts
Remove old bash script for setting up a new project, do everything in
Zig to make it platform agnostic and give us an easy place to add
scaffolding commands in future.
2024-03-06 22:57:11 +00:00

34 lines
918 B
Zig

const std = @import("std");
const compile = @import("compile.zig");
pub fn build(b: *std.Build) !void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
const exe = b.addExecutable(.{
.name = "jetzig",
.root_source_file = .{ .path = "cli.zig" },
.target = target,
.optimize = optimize,
});
const zig_args_dep = b.dependency("args", .{ .target = target, .optimize = optimize });
exe.root_module.addImport("args", zig_args_dep.module("args"));
exe.root_module.addImport(
"init_data",
try compile.initDataModule(b),
);
b.installArtifact(exe);
const run_cmd = b.addRunArtifact(exe);
run_cmd.step.dependOn(b.getInstallStep());
if (b.args) |args| {
run_cmd.addArgs(args);
}
const run_step = b.step("run", "Run the app");
run_step.dependOn(&run_cmd.step);
}