Skip to content

Commit

Permalink
build: add -Dx86 option to enable x86 backend
Browse files Browse the repository at this point in the history
  • Loading branch information
krichprollsch committed Jun 19, 2024
1 parent 6e5f67c commit 2c94a9e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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
// -------

Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);

Expand All @@ -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);

Expand All @@ -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);
Expand Down

0 comments on commit 2c94a9e

Please sign in to comment.