@@ -185,23 +185,14 @@ fn buildLua(b: *Build, target: Build.ResolvedTarget, optimize: std.builtin.Optim
185
185
186
186
lib .linkLibC ();
187
187
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" );
192
192
193
193
return lib ;
194
194
}
195
195
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
-
205
196
/// Luau has diverged enough from Lua (C++, project structure, ...) that it is easier to separate the build logic
206
197
fn buildLuau (b : * Build , target : Build.ResolvedTarget , optimize : std.builtin.OptimizeMode , upstream : * Build.Dependency , luau_use_4_vector : bool ) * Step.Compile {
207
198
const lib = b .addStaticLibrary (.{
@@ -236,9 +227,9 @@ fn buildLuau(b: *Build, target: Build.ResolvedTarget, optimize: std.builtin.Opti
236
227
lib .linkLibCpp ();
237
228
238
229
// 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" );
242
233
243
234
return lib ;
244
235
}
@@ -421,11 +412,11 @@ fn buildLuaJIT(b: *Build, target: Build.ResolvedTarget, optimize: std.builtin.Op
421
412
422
413
lib .root_module .sanitize_c = false ;
423
414
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" );
429
420
430
421
return lib ;
431
422
}
0 commit comments