Skip to content

Commit 95eb344

Browse files
committed
fix: don't add library name config unnecessarily
1 parent 3316b90 commit 95eb344

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

build.zig

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ pub fn build(b: *Build) void {
1616
const optimize = b.standardOptimizeOption(.{});
1717

1818
const lang = b.option(Language, "lang", "Lua language version to build") orelse .lua54;
19-
const library_name = b.option([]const u8, "library_name", "Library name for lua linking, default is `lua`") orelse null;
19+
const library_name = b.option([]const u8, "library_name", "Library name for lua linking, default is `lua`") orelse "lua";
2020
const shared = b.option(bool, "shared", "Build shared library instead of static") orelse false;
2121
const luau_use_4_vector = b.option(bool, "luau_use_4_vector", "Build Luau to use 4-vectors instead of the default 3-vector.") orelse false;
2222

@@ -32,7 +32,6 @@ pub fn build(b: *Build) void {
3232
// Expose build configuration to the ziglua module
3333
const config = b.addOptions();
3434
config.addOption(Language, "lang", lang);
35-
config.addOption(?[]const u8, "library_name", library_name);
3635
config.addOption(bool, "luau_use_4_vector", luau_use_4_vector);
3736
zlua.addOptions("config", config);
3837

build/lua.zig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ pub const Language = enum {
1212
luau,
1313
};
1414

15-
pub fn configure(b: *Build, target: Build.ResolvedTarget, optimize: std.builtin.OptimizeMode, upstream: *Build.Dependency, lang: Language, shared: bool, library_name: ?[]const u8) *Step.Compile {
15+
pub fn configure(b: *Build, target: Build.ResolvedTarget, optimize: std.builtin.OptimizeMode, upstream: *Build.Dependency, lang: Language, shared: bool, library_name: []const u8) *Step.Compile {
1616
const version: std.SemanticVersion = switch (lang) {
1717
.lua51 => .{ .major = 5, .minor = 1, .patch = 5 },
1818
.lua52 => .{ .major = 5, .minor = 2, .patch = 4 },
@@ -23,14 +23,14 @@ pub fn configure(b: *Build, target: Build.ResolvedTarget, optimize: std.builtin.
2323

2424
const lib = if (shared)
2525
b.addSharedLibrary(.{
26-
.name = library_name orelse "lua",
26+
.name = library_name,
2727
.target = target,
2828
.optimize = optimize,
2929
.version = version,
3030
})
3131
else
3232
b.addStaticLibrary(.{
33-
.name = library_name orelse "lua",
33+
.name = library_name,
3434
.target = target,
3535
.optimize = optimize,
3636
.version = version,

0 commit comments

Comments
 (0)