Skip to content

allow using system lua#186

Merged
robbielyman merged 2 commits intonatecraddock:mainfrom
dchinmay2:system-lua
Jan 5, 2026
Merged

allow using system lua#186
robbielyman merged 2 commits intonatecraddock:mainfrom
dchinmay2:system-lua

Conversation

@dchinmay2
Copy link
Contributor

This allows using the zig bindings with system lua

@mischief
Copy link
Contributor

can you add lua 5.5 support, which was just released?

@dchinmay2
Copy link
Contributor Author

Sorry, my distro doesn't have it yet so I can't test it, and ziglua itself doesn't support it yet either

const zlua = b.addModule("zlua", .{
const zlua = if (system) b.addModule("zlua", .{
.root_source_file = b.path("src/lib.zig"),
.target = target,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can't cross compile when using system lua so this should be fine

.lua53 => zlua.linkSystemLibrary("lua5.3", .{ .preferred_link_mode = link_mode }),
.lua54 => zlua.linkSystemLibrary("lua5.4", .{ .preferred_link_mode = link_mode }),
.luajit => zlua.linkSystemLibrary("luajit", .{ .preferred_link_mode = link_mode }),
.luau => @panic("luau not supported for system lua"),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the luau package in my distro doesn't come with libraries or headers

@robbielyman robbielyman merged commit a3c23ef into natecraddock:main Jan 5, 2026
8 checks passed
@dchinmay2
Copy link
Contributor Author

dchinmay2 commented Jan 6, 2026

@robbielyman can this be backported to a branch that works with zig 0.15?

robbielyman added a commit that referenced this pull request Jan 7, 2026
@robbielyman
Copy link
Collaborator

@p00f yup, just did in dca1800

@dchinmay2
Copy link
Contributor Author

thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants