mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 05:44:20 +00:00
build: add build test check for availability of IOS SDK on the host
This commit is contained in:
parent
1e899b8769
commit
517a2c7caf
2 changed files with 13 additions and 3 deletions
|
|
@ -129,6 +129,7 @@ pub fn build(b: *std.Build) !void {
|
|||
"Whether LLVM has the experimental target xtensa enabled",
|
||||
) orelse false;
|
||||
const enable_macos_sdk = b.option(bool, "enable-macos-sdk", "Run tests requiring presence of macOS SDK and frameworks") orelse false;
|
||||
const enable_ios_sdk = b.option(bool, "enable-ios-sdk", "Run tests requiring presence of iOS SDK and frameworks") orelse false;
|
||||
const enable_symlinks_windows = b.option(bool, "enable-symlinks-windows", "Run tests requiring presence of symlinks on Windows") orelse false;
|
||||
const config_h_path_option = b.option([]const u8, "config_h", "Path to the generated config.h");
|
||||
|
||||
|
|
@ -485,11 +486,12 @@ pub fn build(b: *std.Build) !void {
|
|||
b,
|
||||
optimization_modes,
|
||||
enable_macos_sdk,
|
||||
enable_ios_sdk,
|
||||
false,
|
||||
enable_symlinks_windows,
|
||||
));
|
||||
test_step.dependOn(tests.addCAbiTests(b, skip_non_native, skip_release));
|
||||
test_step.dependOn(tests.addLinkTests(b, enable_macos_sdk, false, enable_symlinks_windows));
|
||||
test_step.dependOn(tests.addLinkTests(b, enable_macos_sdk, enable_ios_sdk, false, enable_symlinks_windows));
|
||||
test_step.dependOn(tests.addStackTraceTests(b, test_filter, optimization_modes));
|
||||
test_step.dependOn(tests.addCliTests(b));
|
||||
test_step.dependOn(tests.addAssembleAndLinkTests(b, test_filter, optimization_modes));
|
||||
|
|
|
|||
|
|
@ -566,6 +566,7 @@ pub fn addStandaloneTests(
|
|||
b: *std.Build,
|
||||
optimize_modes: []const OptimizeMode,
|
||||
enable_macos_sdk: bool,
|
||||
enable_ios_sdk: bool,
|
||||
omit_stage2: bool,
|
||||
enable_symlinks_windows: bool,
|
||||
) *Step {
|
||||
|
|
@ -615,10 +616,13 @@ pub fn addStandaloneTests(
|
|||
case.import.requires_symlinks;
|
||||
const requires_macos_sdk = @hasDecl(case.import, "requires_macos_sdk") and
|
||||
case.import.requires_macos_sdk;
|
||||
const requires_ios_sdk = @hasDecl(case.import, "requires_ios_sdk") and
|
||||
case.import.requires_ios_sdk;
|
||||
const bad =
|
||||
(requires_stage2 and omit_stage2) or
|
||||
(requires_symlinks and omit_symlinks) or
|
||||
(requires_macos_sdk and !enable_macos_sdk);
|
||||
(requires_macos_sdk and !enable_macos_sdk) or
|
||||
(requires_ios_sdk and !enable_ios_sdk);
|
||||
if (!bad) {
|
||||
const dep = b.anonymousDependency(case.build_root, case.import, .{});
|
||||
const dep_step = dep.builder.default_step;
|
||||
|
|
@ -635,6 +639,7 @@ pub fn addStandaloneTests(
|
|||
pub fn addLinkTests(
|
||||
b: *std.Build,
|
||||
enable_macos_sdk: bool,
|
||||
enable_ios_sdk: bool,
|
||||
omit_stage2: bool,
|
||||
enable_symlinks_windows: bool,
|
||||
) *Step {
|
||||
|
|
@ -648,10 +653,13 @@ pub fn addLinkTests(
|
|||
case.import.requires_symlinks;
|
||||
const requires_macos_sdk = @hasDecl(case.import, "requires_macos_sdk") and
|
||||
case.import.requires_macos_sdk;
|
||||
const requires_ios_sdk = @hasDecl(case.import, "requires_ios_sdk") and
|
||||
case.import.requires_ios_sdk;
|
||||
const bad =
|
||||
(requires_stage2 and omit_stage2) or
|
||||
(requires_symlinks and omit_symlinks) or
|
||||
(requires_macos_sdk and !enable_macos_sdk);
|
||||
(requires_macos_sdk and !enable_macos_sdk) or
|
||||
(requires_ios_sdk and !enable_ios_sdk);
|
||||
if (!bad) {
|
||||
const dep = b.anonymousDependency(case.build_root, case.import, .{});
|
||||
const dep_step = dep.builder.default_step;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue