Skip to content

Commit

Permalink
Build: Use x86 backend for faster dev cycle
Browse files Browse the repository at this point in the history
  • Loading branch information
kamva9697 committed Nov 5, 2023
1 parent 426c96b commit b03a87d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,18 @@ pub fn build(b: *std.build.Builder) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});

const use_llvm = b.option(bool, "use-llvm", "Use llvm Backend") orelse
!(target.getCpuArch() == .x86_64 and target.getObjectFormat() == .elf);

const exe = b.addExecutable(.{
.name = "monkey",
.root_source_file = .{ .path = "src/main.zig" },
.target = target,
.optimize = optimize,
});

exe.use_llvm = use_llvm;
exe.use_lld = use_llvm;
b.installArtifact(exe);

const run_cmd = b.addRunArtifact(exe);
Expand Down

0 comments on commit b03a87d

Please sign in to comment.