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 @@...@@ -1,25 +1,13 @@
1const std = @import("std");1const std = @import("std");
2const builtin = @import("builtin");
3const Builder = std.build.Builder;2const Builder = std.build.Builder;
4const LibExeObjectStep = std.build.LibExeObjStep;3const LibExeObjectStep = std.build.LibExeObjStep;
54
6pub fn build(b: *Builder) void {5pub 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());
98 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}
2412
25fn testUuid(b: *Builder, test_step: *std.build.Step, mode: std.builtin.Mode, comptime exp: []const u8) void {13fn 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
45fn simpleDylib(b: *Builder, mode: std.builtin.Mode) *LibExeObjectStep {33fn 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;