@@ -185,23 +185,14 @@ fn buildLua(b: *Build, target: Build.ResolvedTarget, optimize: std.builtin.Optim
185185
186186 lib .linkLibC ();
187187
188- installHeader (lib , upstream .path ("src/lua.h" ), "lua.h" );
189- installHeader (lib , upstream .path ("src/lualib.h" ), "lualib.h" );
190- installHeader (lib , upstream .path ("src/lauxlib.h" ), "lauxlib.h" );
191- installHeader (lib , upstream .path ("src/luaconf.h" ), "luaconf.h" );
188+ lib . installHeader (upstream .path ("src/lua.h" ), "lua.h" );
189+ lib . installHeader (upstream .path ("src/lualib.h" ), "lualib.h" );
190+ lib . installHeader (upstream .path ("src/lauxlib.h" ), "lauxlib.h" );
191+ lib . installHeader (upstream .path ("src/luaconf.h" ), "luaconf.h" );
192192
193193 return lib ;
194194}
195195
196- // The Build.Step.Compile.installHeader function isn't updated to work with LazyPath
197- // TODO: report as an issue to Zig (and possibly fix?)
198- fn installHeader (cs : * Build.Step.Compile , src_path : Build.LazyPath , dest_rel_path : []const u8 ) void {
199- const b = cs .step .owner ;
200- const install_file = b .addInstallFileWithDir (src_path , .header , dest_rel_path );
201- b .getInstallStep ().dependOn (& install_file .step );
202- cs .installed_headers .append (& install_file .step ) catch @panic ("OOM" );
203- }
204-
205196/// Luau has diverged enough from Lua (C++, project structure, ...) that it is easier to separate the build logic
206197fn buildLuau (b : * Build , target : Build.ResolvedTarget , optimize : std.builtin.OptimizeMode , upstream : * Build.Dependency , luau_use_4_vector : bool ) * Step.Compile {
207198 const lib = b .addStaticLibrary (.{
@@ -236,9 +227,9 @@ fn buildLuau(b: *Build, target: Build.ResolvedTarget, optimize: std.builtin.Opti
236227 lib .linkLibCpp ();
237228
238229 // It may not be as likely that other software links against Luau, but might as well expose these anyway
239- installHeader (lib , upstream .path ("VM/include/lua.h" ), "lua.h" );
240- installHeader (lib , upstream .path ("VM/include/lualib.h" ), "lualib.h" );
241- installHeader (lib , upstream .path ("VM/include/luaconf.h" ), "luaconf.h" );
230+ lib . installHeader (upstream .path ("VM/include/lua.h" ), "lua.h" );
231+ lib . installHeader (upstream .path ("VM/include/lualib.h" ), "lualib.h" );
232+ lib . installHeader (upstream .path ("VM/include/luaconf.h" ), "luaconf.h" );
242233
243234 return lib ;
244235}
@@ -421,11 +412,11 @@ fn buildLuaJIT(b: *Build, target: Build.ResolvedTarget, optimize: std.builtin.Op
421412
422413 lib .root_module .sanitize_c = false ;
423414
424- installHeader (lib , upstream .path ("src/lua.h" ), "lua.h" );
425- installHeader (lib , upstream .path ("src/lualib.h" ), "lualib.h" );
426- installHeader (lib , upstream .path ("src/lauxlib.h" ), "lauxlib.h" );
427- installHeader (lib , upstream .path ("src/luaconf.h" ), "luaconf.h" );
428- installHeader (lib , luajit_h , "luajit.h" );
415+ lib . installHeader (upstream .path ("src/lua.h" ), "lua.h" );
416+ lib . installHeader (upstream .path ("src/lualib.h" ), "lualib.h" );
417+ lib . installHeader (upstream .path ("src/lauxlib.h" ), "lauxlib.h" );
418+ lib . installHeader (upstream .path ("src/luaconf.h" ), "luaconf.h" );
419+ lib . installHeader (luajit_h , "luajit.h" );
429420
430421 return lib ;
431422}
0 commit comments