aboutsummaryrefslogtreecommitdiff
path: root/build.zig
diff options
context:
space:
mode:
authorJakub Konka <kubkon@jakubkonka.com>2021-08-02 10:04:54 +0200
committerAndrew Kelley <andrew@ziglang.org>2021-08-02 13:41:58 -0400
commit159cd528b164f77177e71309dee9fa79d2d5f4f4 (patch)
tree364c79201b35da2319f8225e0a8138ee70ba3c4c /build.zig
parent68e26a2ceea85a149cb23286504cbdcec1ae814e (diff)
downloadzig-159cd528b164f77177e71309dee9fa79d2d5f4f4.tar.gz
zig-159cd528b164f77177e71309dee9fa79d2d5f4f4.zip
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`.
Diffstat (limited to 'build.zig')
-rw-r--r--build.zig3
1 files changed, 2 insertions, 1 deletions
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));