@@ -23,8 +23,6 @@ pub fn build(b: *Build) void {
23
23
const shared = b .option (bool , "shared" , "Build shared library instead of static" ) orelse false ;
24
24
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 ;
25
25
26
- const upstream = b .lazyDependency (@tagName (lang ), .{}) orelse return ;
27
-
28
26
if (lang == .luau and shared ) {
29
27
std .debug .panic ("Luau does not support compiling or loading shared modules" , .{});
30
28
}
@@ -45,27 +43,31 @@ pub fn build(b: *Build) void {
45
43
ziglua .addCMacro ("LUA_VECTOR_SIZE" , b .fmt ("{}" , .{vector_size }));
46
44
}
47
45
48
- const lib = switch (lang ) {
49
- .luajit = > buildLuaJIT (b , target , optimize , upstream , shared ),
50
- .luau = > buildLuau (b , target , optimize , upstream , luau_use_4_vector ),
51
- else = > buildLua (b , target , optimize , upstream , lang , shared ),
52
- };
53
-
54
- // Expose the Lua artifact
55
- b .installArtifact (lib );
56
-
57
- switch (lang ) {
58
- .luau = > {
59
- ziglua .addIncludePath (upstream .path ("Common/include" ));
60
- ziglua .addIncludePath (upstream .path ("Compiler/include" ));
61
- ziglua .addIncludePath (upstream .path ("Ast/include" ));
62
- ziglua .addIncludePath (upstream .path ("VM/include" ));
63
- },
64
- else = > ziglua .addIncludePath (upstream .path ("src" )),
46
+ luadep : {
47
+ const upstream = b .lazyDependency (@tagName (lang ), .{}) orelse break :luadep ;
48
+
49
+ const lib = switch (lang ) {
50
+ .luajit = > buildLuaJIT (b , target , optimize , upstream , shared ),
51
+ .luau = > buildLuau (b , target , optimize , upstream , luau_use_4_vector ),
52
+ else = > buildLua (b , target , optimize , upstream , lang , shared ),
53
+ };
54
+
55
+ // Expose the Lua artifact
56
+ b .installArtifact (lib );
57
+
58
+ switch (lang ) {
59
+ .luau = > {
60
+ ziglua .addIncludePath (upstream .path ("Common/include" ));
61
+ ziglua .addIncludePath (upstream .path ("Compiler/include" ));
62
+ ziglua .addIncludePath (upstream .path ("Ast/include" ));
63
+ ziglua .addIncludePath (upstream .path ("VM/include" ));
64
+ },
65
+ else = > ziglua .addIncludePath (upstream .path ("src" )),
66
+ }
67
+
68
+ ziglua .linkLibrary (lib );
65
69
}
66
70
67
- ziglua .linkLibrary (lib );
68
-
69
71
// Tests
70
72
const tests = b .addTest (.{
71
73
.root_source_file = .{ .path = "src/tests.zig" },
0 commit comments