Skip to content

Commit b20a610

Browse files
committed
link-tests: force cross-comp to exclude host differences
1 parent 9ad24a4 commit b20a610

File tree

1 file changed

+4
-16
lines changed

1 file changed

+4
-16
lines changed

test/link/macho/uuid/build.zig

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,13 @@
11
const std = @import("std");
2-
const builtin = @import("builtin");
32
const Builder = std.build.Builder;
43
const LibExeObjectStep = std.build.LibExeObjStep;
54

65
pub fn build(b: *Builder) void {
76
const test_step = b.step("test", "Test");
87
test_step.dependOn(b.getInstallStep());
9-
10-
switch (builtin.cpu.arch) {
11-
.aarch64 => {
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-
}
8+
testUuid(b, test_step, .ReleaseSafe, "eb1203019e453d808d4f1e71053af9af");
9+
testUuid(b, test_step, .ReleaseFast, "eb1203019e453d808d4f1e71053af9af");
10+
testUuid(b, test_step, .ReleaseSmall, "eb1203019e453d808d4f1e71053af9af");
2311
}
2412

2513
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
4533
fn simpleDylib(b: *Builder, mode: std.builtin.Mode) *LibExeObjectStep {
4634
const dylib = b.addSharedLibrary("test", null, b.version(1, 0, 0));
4735
dylib.setBuildMode(mode);
48-
dylib.setTarget(.{ .os_tag = .macos });
36+
dylib.setTarget(.{ .cpu_arch = .aarch64, .os_tag = .macos });
4937
dylib.addCSourceFile("test.c", &.{});
5038
dylib.linkLibC();
5139
return dylib;

0 commit comments

Comments
 (0)