You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
1.1 KiB
41 lines
1.1 KiB
const std = @import("std");
|
|
const lua = @import("lib/luajit/build.zig");
|
|
|
|
pub fn build(b: *std.build.Builder) !void {
|
|
var gpa = std.heap.GeneralPurposeAllocator(.{}){};
|
|
defer std.debug.assert(gpa.deinit() != .leak);
|
|
|
|
const allocator = gpa.allocator();
|
|
|
|
var arena = std.heap.ArenaAllocator.init(allocator);
|
|
defer arena.deinit();
|
|
|
|
const arena_allocator = arena.allocator();
|
|
|
|
const target = b.standardTargetOptions(.{});
|
|
const mode = b.standardOptimizeOption(.{});
|
|
|
|
const exe = b.addExecutable(.{
|
|
.name = "econ",
|
|
.root_source_file = .{ .path = "src/main.zig" },
|
|
.target = target,
|
|
.optimize = mode,
|
|
});
|
|
|
|
exe.addAnonymousModule(
|
|
"ringbuffer",
|
|
.{ .source_file = .{ .path = "lib/ringbuffer/src/lib.zig" } },
|
|
);
|
|
try lua.addLuajit(arena_allocator, exe);
|
|
|
|
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);
|
|
}
|
|
|