| ... | @@ -0,0 +1,25 @@ |
| 1 | const std = @import("std"); |
| 2 | const Builder = std.build.Builder; |
| 3 | |
| 4 | pub fn build(b: *Builder) void { |
| 5 | const mode = b.standardReleaseOptions(); |
| 6 | |
| 7 | const test_step = b.step("test", "Test"); |
| 8 | test_step.dependOn(b.getInstallStep()); |
| 9 | |
| 10 | const exe = b.addExecutable("main", null); |
| 11 | exe.setBuildMode(mode); |
| 12 | exe.addCSourceFile("main.c", &.{}); |
| 13 | exe.linkLibC(); |
| 14 | exe.headerpad_size = 0x10000; |
| 15 | |
| 16 | const check = exe.checkObject(.macho); |
| 17 | check.checkStart("sectname __text"); |
| 18 | check.checkNext("offset {offset}"); |
| 19 | check.checkComputeCompare("offset", .{ .op = .gte, .value = .{ .literal = 0x10000 } }); |
| 20 | |
| 21 | test_step.dependOn(&check.step); |
| 22 | |
| 23 | const run = exe.run(); |
| 24 | test_step.dependOn(&run.step); |
| 25 | } |