mirror of
https://github.com/ziglang/zig.git
synced 2024-12-03 10:28:48 +00:00
c7f9833238
* `--verbose-llvm-ir` should trigger analysis and codegen * `-femit-asm` etc should trigger codegen even with `-fno-emit-bin` Closes #12588
19 lines
593 B
Zig
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);
|
|
}
|