authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2023-08-18 11:57:12+02:00
committergravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2023-08-18 11:57:12+02:00
log517a2c7cafd75e963033df479aef0916c7a4181a
tree7b3236c1c66bc6e6f62f7ff7c5cb190431b27175
parent1e899b8769546d9189f21fbb9a5c58c32657fb8a

build: add build test check for availability of IOS SDK on the host


2 files changed, 13 insertions(+), 3 deletions(-)

build.zig+3-1
...@@ -129,6 +129,7 @@ pub fn build(b: *std.Build) !void {...@@ -129,6 +129,7 @@ pub fn build(b: *std.Build) !void {
129 "Whether LLVM has the experimental target xtensa enabled",129 "Whether LLVM has the experimental target xtensa enabled",
130 ) orelse false;130 ) orelse false;
131 const enable_macos_sdk = b.option(bool, "enable-macos-sdk", "Run tests requiring presence of macOS SDK and frameworks") orelse false;131 const enable_macos_sdk = b.option(bool, "enable-macos-sdk", "Run tests requiring presence of macOS SDK and frameworks") orelse false;
132 const enable_ios_sdk = b.option(bool, "enable-ios-sdk", "Run tests requiring presence of iOS SDK and frameworks") orelse false;
132 const enable_symlinks_windows = b.option(bool, "enable-symlinks-windows", "Run tests requiring presence of symlinks on Windows") orelse false;133 const enable_symlinks_windows = b.option(bool, "enable-symlinks-windows", "Run tests requiring presence of symlinks on Windows") orelse false;
133 const config_h_path_option = b.option([]const u8, "config_h", "Path to the generated config.h");134 const config_h_path_option = b.option([]const u8, "config_h", "Path to the generated config.h");
134135
...@@ -485,11 +486,12 @@ pub fn build(b: *std.Build) !void {...@@ -485,11 +486,12 @@ pub fn build(b: *std.Build) !void {
485 b,486 b,
486 optimization_modes,487 optimization_modes,
487 enable_macos_sdk,488 enable_macos_sdk,
489 enable_ios_sdk,
488 false,490 false,
489 enable_symlinks_windows,491 enable_symlinks_windows,
490 ));492 ));
491 test_step.dependOn(tests.addCAbiTests(b, skip_non_native, skip_release));493 test_step.dependOn(tests.addCAbiTests(b, skip_non_native, skip_release));
492 test_step.dependOn(tests.addLinkTests(b, enable_macos_sdk, false, enable_symlinks_windows));494 test_step.dependOn(tests.addLinkTests(b, enable_macos_sdk, enable_ios_sdk, false, enable_symlinks_windows));
493 test_step.dependOn(tests.addStackTraceTests(b, test_filter, optimization_modes));495 test_step.dependOn(tests.addStackTraceTests(b, test_filter, optimization_modes));
494 test_step.dependOn(tests.addCliTests(b));496 test_step.dependOn(tests.addCliTests(b));
495 test_step.dependOn(tests.addAssembleAndLinkTests(b, test_filter, optimization_modes));497 test_step.dependOn(tests.addAssembleAndLinkTests(b, test_filter, optimization_modes));
test/tests.zig+10-2
...@@ -566,6 +566,7 @@ pub fn addStandaloneTests(...@@ -566,6 +566,7 @@ pub fn addStandaloneTests(
566 b: *std.Build,566 b: *std.Build,
567 optimize_modes: []const OptimizeMode,567 optimize_modes: []const OptimizeMode,
568 enable_macos_sdk: bool,568 enable_macos_sdk: bool,
569 enable_ios_sdk: bool,
569 omit_stage2: bool,570 omit_stage2: bool,
570 enable_symlinks_windows: bool,571 enable_symlinks_windows: bool,
571) *Step {572) *Step {
...@@ -615,10 +616,13 @@ pub fn addStandaloneTests(...@@ -615,10 +616,13 @@ pub fn addStandaloneTests(
615 case.import.requires_symlinks;616 case.import.requires_symlinks;
616 const requires_macos_sdk = @hasDecl(case.import, "requires_macos_sdk") and617 const requires_macos_sdk = @hasDecl(case.import, "requires_macos_sdk") and
617 case.import.requires_macos_sdk;618 case.import.requires_macos_sdk;
619 const requires_ios_sdk = @hasDecl(case.import, "requires_ios_sdk") and
620 case.import.requires_ios_sdk;
618 const bad =621 const bad =
619 (requires_stage2 and omit_stage2) or622 (requires_stage2 and omit_stage2) or
620 (requires_symlinks and omit_symlinks) or623 (requires_symlinks and omit_symlinks) or
621 (requires_macos_sdk and !enable_macos_sdk);624 (requires_macos_sdk and !enable_macos_sdk) or
625 (requires_ios_sdk and !enable_ios_sdk);
622 if (!bad) {626 if (!bad) {
623 const dep = b.anonymousDependency(case.build_root, case.import, .{});627 const dep = b.anonymousDependency(case.build_root, case.import, .{});
624 const dep_step = dep.builder.default_step;628 const dep_step = dep.builder.default_step;
...@@ -635,6 +639,7 @@ pub fn addStandaloneTests(...@@ -635,6 +639,7 @@ pub fn addStandaloneTests(
635pub fn addLinkTests(639pub fn addLinkTests(
636 b: *std.Build,640 b: *std.Build,
637 enable_macos_sdk: bool,641 enable_macos_sdk: bool,
642 enable_ios_sdk: bool,
638 omit_stage2: bool,643 omit_stage2: bool,
639 enable_symlinks_windows: bool,644 enable_symlinks_windows: bool,
640) *Step {645) *Step {
...@@ -648,10 +653,13 @@ pub fn addLinkTests(...@@ -648,10 +653,13 @@ pub fn addLinkTests(
648 case.import.requires_symlinks;653 case.import.requires_symlinks;
649 const requires_macos_sdk = @hasDecl(case.import, "requires_macos_sdk") and654 const requires_macos_sdk = @hasDecl(case.import, "requires_macos_sdk") and
650 case.import.requires_macos_sdk;655 case.import.requires_macos_sdk;
656 const requires_ios_sdk = @hasDecl(case.import, "requires_ios_sdk") and
657 case.import.requires_ios_sdk;
651 const bad =658 const bad =
652 (requires_stage2 and omit_stage2) or659 (requires_stage2 and omit_stage2) or
653 (requires_symlinks and omit_symlinks) or660 (requires_symlinks and omit_symlinks) or
654 (requires_macos_sdk and !enable_macos_sdk);661 (requires_macos_sdk and !enable_macos_sdk) or
662 (requires_ios_sdk and !enable_ios_sdk);
655 if (!bad) {663 if (!bad) {
656 const dep = b.anonymousDependency(case.build_root, case.import, .{});664 const dep = b.anonymousDependency(case.build_root, case.import, .{});
657 const dep_step = dep.builder.default_step;665 const dep_step = dep.builder.default_step;