zig/test/standalone/issue_12588/build.zig
Jacob Young c7f9833238 Module: fix early exit conditions during compilation
* `--verbose-llvm-ir` should trigger analysis and codegen
 * `-femit-asm` etc should trigger codegen even with `-fno-emit-bin`

Closes #12588
2022-10-15 14:18:35 -04:00

19 lines
593 B
Zig

const std = @import("std");
const Builder = std.build.Builder;
pub fn build(b: *Builder) void {
const mode = b.standardReleaseOptions();
const target = b.standardTargetOptions(.{});
const obj = b.addObject("main", "main.zig");
obj.setBuildMode(mode);
obj.setTarget(target);
obj.emit_llvm_ir = .{ .emit_to = b.pathFromRoot("main.ll") };
obj.emit_llvm_bc = .{ .emit_to = b.pathFromRoot("main.bc") };
obj.emit_bin = .no_emit;
b.default_step.dependOn(&obj.step);
const test_step = b.step("test", "Test the program");
test_step.dependOn(&obj.step);
}