From 159cd528b164f77177e71309dee9fa79d2d5f4f4 Mon Sep 17 00:00:00 2001 From: Jakub Konka Date: Mon, 2 Aug 2021 10:04:54 +0200 Subject: Add -Denable-macos-sdk explicit flag to build.zig This way, we can explicitly signal if a test requires the presence of macOS SDK to build. For instance, when testing our in-house MachO linker for correctly linking Objective-C, we require the presence of the SDK on the host system, and we can enforce this with `-Denable-macos-sdk` flag to `zig build test-standalone`. --- build.zig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'build.zig') diff --git a/build.zig b/build.zig index 40e1b36e71..f60cd573a4 100644 --- a/build.zig +++ b/build.zig @@ -61,6 +61,7 @@ pub fn build(b: *Builder) !void { const omit_stage2 = b.option(bool, "omit-stage2", "Do not include stage2 behind a feature flag inside stage1") orelse false; const static_llvm = b.option(bool, "static-llvm", "Disable integration with system-installed LLVM, Clang, LLD, and libc++") orelse false; const enable_llvm = b.option(bool, "enable-llvm", "Build self-hosted compiler with LLVM backend enabled") orelse (is_stage1 or static_llvm); + const enable_macos_sdk = b.option(bool, "enable-macos-sdk", "Run tests requiring presence of macOS SDK and frameworks") orelse false; const config_h_path_option = b.option([]const u8, "config_h", "Path to the generated config.h"); if (!skip_install_lib_files) { @@ -340,7 +341,7 @@ pub fn build(b: *Builder) !void { )); toolchain_step.dependOn(tests.addCompareOutputTests(b, test_filter, modes)); - toolchain_step.dependOn(tests.addStandaloneTests(b, test_filter, modes, skip_non_native, target)); + toolchain_step.dependOn(tests.addStandaloneTests(b, test_filter, modes, skip_non_native, enable_macos_sdk, target)); toolchain_step.dependOn(tests.addStackTraceTests(b, test_filter, modes)); toolchain_step.dependOn(tests.addCliTests(b, test_filter, modes)); toolchain_step.dependOn(tests.addAssembleAndLinkTests(b, test_filter, modes)); -- cgit v1.2.3