File tree 2 files changed +28
-0
lines changed
2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change
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
+ }
Original file line number Diff line number Diff line change
1
+ int main (int argc , char * argv []) {
2
+ return 0 ;
3
+ }
You can’t perform that action at this time.
0 commit comments