Skip to content

Commit bedd9d0

Browse files
committed
fix(build): build.zig: use luajit for windows
These were disabled as they failed when tested with cross-compiling, but it works fine for windows natively on ci, so let's use that. mac os builds after disabling debug info, which currently triggers a bug in zig's MachO linker: natecraddock/ziglua#191 Tracking issue: https://codeberg.org/ziglang/zig/issues/30669 Unfortunately actually using the JIT of luajit still triggers issues on mac os, so we cannot use it yet. Also sync luajit version used via ziglua to a recent one like we use in cmake, see natecraddock/ziglua#196
1 parent a520d9c commit bedd9d0

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

build.zig

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,7 @@ pub fn build(b: *std.Build) !void {
6161
// puc lua 5.1 is not ReleaseSafe "safe"
6262
const optimize_lua = if (optimize == .Debug or optimize == .ReleaseSafe) .ReleaseSmall else optimize;
6363

64-
const arch = t.cpu.arch;
65-
const default_luajit = (is_linux and arch == .x86_64) or (is_darwin and arch == .aarch64);
66-
const use_luajit = b.option(bool, "luajit", "use luajit") orelse default_luajit;
64+
const use_luajit = b.option(bool, "luajit", "use luajit") orelse true;
6765
const lualib_name = if (use_luajit) "luajit" else "lua5.1";
6866
const host_use_luajit = if (cross_compiling) false else use_luajit;
6967
const E = enum { luajit, lua51 };

build.zig.zon

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66

77
.dependencies = .{
88
.zlua = .{
9-
.url = "git+https://github.com/natecraddock/ziglua#dca1800ea46f5a19fc9abf88b2f8c1617f86ac23",
10-
.hash = "zlua-0.1.0-hGRpC1dCBQDf-IqqUifYvyr8B9-4FlYXqY8cl7HIetrC",
9+
.url = "git+https://github.com/natecraddock/ziglua#a1cae53f6b841dd4fa108103f4bd0f515ca29cfb",
10+
.hash = "zlua-0.1.0-hGRpCwxDBQD25I09a5dhcaNCEontuUsq2pgB34wjugHQ",
1111
},
1212
.lpeg = .{
1313
.url = "https://github.com/neovim/deps/raw/d495ee6f79e7962a53ad79670cb92488abe0b9b4/opt/lpeg-1.1.0.tar.gz",

0 commit comments

Comments
 (0)