authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2022-12-17 00:53:47+01:00
committergravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2022-12-17 00:53:47+01:00
logb20a610f03b0c281958802770b927cde5f47b99c
tree1ecd16265021f6ba1b15ee7d5ccff5eb0302da84
parent9ad24a4aee839437a10d1038bb2f99a2abdbf1c2

link-tests: force cross-comp to exclude host differences


1 files changed, 4 insertions(+), 16 deletions(-)

test/link/macho/uuid/build.zig+4-16
......@@ -1,25 +1,13 @@
11const std = @import("std");
2const builtin = @import("builtin");
32const Builder = std.build.Builder;
43const LibExeObjectStep = std.build.LibExeObjStep;
54
65pub 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
2513fn 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
4533fn 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;