| ... | @@ -1,25 +1,13 @@ | ... | @@ -1,25 +1,13 @@ |
| 1 | const std = @import("std"); | 1 | const std = @import("std"); |
| 2 | const builtin = @import("builtin"); | | |
| 3 | const Builder = std.build.Builder; | 2 | const Builder = std.build.Builder; |
| 4 | const LibExeObjectStep = std.build.LibExeObjStep; | 3 | const LibExeObjectStep = std.build.LibExeObjStep; |
| 5 | | 4 | |
| 6 | pub fn build(b: *Builder) void { | 5 | pub fn build(b: *Builder) void { |
| 7 | const test_step = b.step("test", "Test"); | 6 | const test_step = b.step("test", "Test"); |
| 8 | test_step.dependOn(b.getInstallStep()); | 7 | test_step.dependOn(b.getInstallStep()); |
| 9 | | 8 | testUuid(b, test_step, .ReleaseSafe, "eb1203019e453d808d4f1e71053af9af"); |
| 10 | switch (builtin.cpu.arch) { | 9 | testUuid(b, test_step, .ReleaseFast, "eb1203019e453d808d4f1e71053af9af"); |
| 11 | .aarch64 => { | 10 | testUuid(b, test_step, .ReleaseSmall, "eb1203019e453d808d4f1e71053af9af"); |
| 12 | testUuid(b, test_step, .ReleaseSafe, "eb1203019e453d808d4f1e71053af9af"); | | |
| 13 | testUuid(b, test_step, .ReleaseFast, "eb1203019e453d808d4f1e71053af9af"); | | |
| 14 | testUuid(b, test_step, .ReleaseSmall, "eb1203019e453d808d4f1e71053af9af"); | | |
| 15 | }, | | |
| 16 | .x86_64 => { | | |
| 17 | testUuid(b, test_step, .ReleaseSafe, "b3598e7c42dc38b0bd2975ead6e4ae85"); | | |
| 18 | testUuid(b, test_step, .ReleaseFast, "b3598e7c42dc38b0bd2975ead6e4ae85"); | | |
| 19 | testUuid(b, test_step, .ReleaseSmall, "1064b25eef4e3e6391866188b3dd7156"); | | |
| 20 | }, | | |
| 21 | else => unreachable, | | |
| 22 | } | | |
| 23 | } | 11 | } |
| 24 | | 12 | |
| 25 | fn testUuid(b: *Builder, test_step: *std.build.Step, mode: std.builtin.Mode, comptime exp: []const u8) void { | 13 | fn testUuid(b: *Builder, test_step: *std.build.Step, mode: std.builtin.Mode, comptime exp: []const u8) void { |
| ... | @@ -45,7 +33,7 @@ fn testUuid(b: *Builder, test_step: *std.build.Step, mode: std.builtin.Mode, com | ... | @@ -45,7 +33,7 @@ fn testUuid(b: *Builder, test_step: *std.build.Step, mode: std.builtin.Mode, com |
| 45 | fn simpleDylib(b: *Builder, mode: std.builtin.Mode) *LibExeObjectStep { | 33 | fn simpleDylib(b: *Builder, mode: std.builtin.Mode) *LibExeObjectStep { |
| 46 | const dylib = b.addSharedLibrary("test", null, b.version(1, 0, 0)); | 34 | const dylib = b.addSharedLibrary("test", null, b.version(1, 0, 0)); |
| 47 | dylib.setBuildMode(mode); | 35 | dylib.setBuildMode(mode); |
| 48 | dylib.setTarget(.{ .os_tag = .macos }); | 36 | dylib.setTarget(.{ .cpu_arch = .aarch64, .os_tag = .macos }); |
| 49 | dylib.addCSourceFile("test.c", &.{}); | 37 | dylib.addCSourceFile("test.c", &.{}); |
| 50 | dylib.linkLibC(); | 38 | dylib.linkLibC(); |
| 51 | return dylib; | 39 | return dylib; |