aboutsummaryrefslogtreecommitdiff
path: root/build.zig
diff options
context:
space:
mode:
authorJakub Konka <kubkon@jakubkonka.com>2021-12-01 23:33:28 +0100
committerJakub Konka <kubkon@jakubkonka.com>2021-12-02 00:22:09 +0100
commit852841fd1f82bb5ba5ecdf9a85a1f15ef70e6dd0 (patch)
tree68268845bdc0cf075b0755e4213697e6309a9a25 /build.zig
parent3e2f8233a86bf4a2787eb6d37a54b9c8eae8a985 (diff)
downloadzig-852841fd1f82bb5ba5ecdf9a85a1f15ef70e6dd0.tar.gz
zig-852841fd1f82bb5ba5ecdf9a85a1f15ef70e6dd0.zip
Make Rosetta availability declarative by the user
Like QEMU or Wine, you need to declare you want Rosetta enabled for running tests/build artifacts via `-Denable-rosetta` flag.
Diffstat (limited to 'build.zig')
-rw-r--r--build.zig6
1 files changed, 6 insertions, 0 deletions
diff --git a/build.zig b/build.zig
index 5887d2a932..28d1486ad0 100644
--- a/build.zig
+++ b/build.zig
@@ -300,6 +300,7 @@ pub fn build(b: *Builder) !void {
const is_qemu_enabled = b.option(bool, "enable-qemu", "Use QEMU to run cross compiled foreign architecture tests") orelse false;
const is_wasmtime_enabled = b.option(bool, "enable-wasmtime", "Use Wasmtime to enable and run WASI libstd tests") orelse false;
const is_darling_enabled = b.option(bool, "enable-darling", "[Experimental] Use Darling to run cross compiled macOS tests") orelse false;
+ const is_rosetta_enabled = b.option(bool, "enable-rosetta", "(Darwin) Use Rosetta to run x86_64 macOS tests on arm64 macOS") orelse false;
const glibc_multi_dir = b.option([]const u8, "enable-foreign-glibc", "Provide directory with glibc installations to run cross compiled tests that link glibc");
const test_stage2_options = b.addOptions();
@@ -319,6 +320,7 @@ pub fn build(b: *Builder) !void {
test_stage2_options.addOption(bool, "enable_qemu", is_qemu_enabled);
test_stage2_options.addOption(bool, "enable_wine", is_wine_enabled);
test_stage2_options.addOption(bool, "enable_wasmtime", is_wasmtime_enabled);
+ test_stage2_options.addOption(bool, "enable_rosetta", is_rosetta_enabled);
test_stage2_options.addOption(u32, "mem_leak_frames", mem_leak_frames * 2);
test_stage2_options.addOption(bool, "enable_darling", is_darling_enabled);
test_stage2_options.addOption(?[]const u8, "glibc_multi_install_dir", glibc_multi_dir);
@@ -370,6 +372,7 @@ pub fn build(b: *Builder) !void {
is_qemu_enabled,
is_wasmtime_enabled,
is_darling_enabled,
+ is_rosetta_enabled,
glibc_multi_dir,
));
@@ -387,6 +390,7 @@ pub fn build(b: *Builder) !void {
is_qemu_enabled,
is_wasmtime_enabled,
is_darling_enabled,
+ is_rosetta_enabled,
glibc_multi_dir,
));
@@ -404,6 +408,7 @@ pub fn build(b: *Builder) !void {
is_qemu_enabled,
is_wasmtime_enabled,
is_darling_enabled,
+ is_rosetta_enabled,
glibc_multi_dir,
));
@@ -434,6 +439,7 @@ pub fn build(b: *Builder) !void {
is_qemu_enabled,
is_wasmtime_enabled,
is_darling_enabled,
+ is_rosetta_enabled,
glibc_multi_dir,
);