2017-05-01 13:35:10 -07:00
|
|
|
const Builder = @import("std").build.Builder;
|
|
|
|
|
2018-01-31 19:48:40 -08:00
|
|
|
pub fn build(b: &Builder) !void {
|
2017-05-01 13:35:10 -07:00
|
|
|
const exe = b.addExecutable("test", "test.zig");
|
|
|
|
exe.addPackagePath("my_pkg", "pkg.zig");
|
|
|
|
|
2017-05-09 18:20:09 -07:00
|
|
|
// This is duplicated to test that you are allowed to call
|
|
|
|
// b.standardReleaseOptions() twice.
|
|
|
|
exe.setBuildMode(b.standardReleaseOptions());
|
|
|
|
exe.setBuildMode(b.standardReleaseOptions());
|
|
|
|
|
2017-09-25 22:01:49 -07:00
|
|
|
const run = b.addCommand(".", b.env_map, [][]const u8{exe.getOutputPath()});
|
2017-05-01 13:35:10 -07:00
|
|
|
run.step.dependOn(&exe.step);
|
|
|
|
|
|
|
|
const test_step = b.step("test", "Test it");
|
|
|
|
test_step.dependOn(&run.step);
|
|
|
|
}
|