diff options
Diffstat (limited to 'clox/build.zig')
| -rw-r--r-- | clox/build.zig | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/clox/build.zig b/clox/build.zig new file mode 100644 index 0000000..4265e8a --- /dev/null +++ b/clox/build.zig @@ -0,0 +1,34 @@ +const std = @import("std"); +const builtin = @import("builtin"); + +pub fn build(b: *std.Build) void { + const target = b.standardTargetOptions(.{}); + const optimize = b.standardOptimizeOption(.{}); + + const root = b.addModule("game-mod", .{ + .optimize = optimize, + .target = target, + .link_libc = true, + }); + + root.addCSourceFiles(.{ + .files = &[_][]const u8 { + "src/main.c", + } + }); + + const exe = b.addExecutable(.{ + .name = "clox", + .root_module = root, + }); + + + b.installArtifact(exe); + + const run_step = b.step("run", "Run the app"); + const run_cmd = b.addRunArtifact(exe); + run_step.dependOn(&run_cmd.step); + if (b.args) |args| { + run_cmd.addArgs(args); + } +} |
