From dabded8d1e66d765841772b062701a753f47c6b8 Mon Sep 17 00:00:00 2001 From: Pierre Tachoire Date: Wed, 19 Jun 2024 09:23:33 +0200 Subject: [PATCH] build: add -Dx86 option to enable x86 backend see https://ziglang.org/download/0.12.0/release-notes.html#x86-Backend --- build.zig | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/build.zig b/build.zig index 75c6b396..fa92104f 100644 --- a/build.zig +++ b/build.zig @@ -47,6 +47,8 @@ pub fn build(b: *std.Build) !void { const options = try jsruntime.buildOptions(b); + const x86 = b.option(bool, "x86", "Use x86 backend") orelse false; + // browser // ------- @@ -56,6 +58,8 @@ pub fn build(b: *std.Build) !void { .root_source_file = b.path("src/main.zig"), .target = target, .optimize = mode, + .use_llvm = !x86, + .use_lld = !x86, }); try common(b, exe, options); b.installArtifact(exe); @@ -79,6 +83,8 @@ pub fn build(b: *std.Build) !void { .root_source_file = b.path("src/main_shell.zig"), .target = target, .optimize = mode, + .use_llvm = !x86, + .use_lld = !x86, }); try common(b, shell, options); try jsruntime_pkgs.add_shell(shell); @@ -102,6 +108,8 @@ pub fn build(b: *std.Build) !void { .test_runner = b.path("src/test_runner.zig"), .target = target, .optimize = mode, + .use_llvm = !x86, + .use_lld = !x86, }); try common(b, tests, options); @@ -128,6 +136,8 @@ pub fn build(b: *std.Build) !void { .root_source_file = b.path("src/main_wpt.zig"), .target = target, .optimize = mode, + .use_llvm = !x86, + .use_lld = !x86, }); try common(b, wpt, options); @@ -149,6 +159,8 @@ pub fn build(b: *std.Build) !void { .root_source_file = b.path("src/main_get.zig"), .target = target, .optimize = mode, + .use_llvm = !x86, + .use_lld = !x86, }); try common(b, get, options); b.installArtifact(get);