mirror of
https://github.com/NeoFlock/neonucleus.git
synced 2025-09-24 09:03:32 +02:00
fixed a bug related to Lua includes
This commit is contained in:
parent
7a43ed0727
commit
f4bf8e1d62
18
build.zig
18
build.zig
@ -79,8 +79,6 @@ fn compileTheRightLua(b: *std.Build, target: std.Build.ResolvedTarget, version:
|
|||||||
|
|
||||||
const rootPath = try std.mem.join(alloc, std.fs.path.sep_str, &.{ "foreign", dirName });
|
const rootPath = try std.mem.join(alloc, std.fs.path.sep_str, &.{ "foreign", dirName });
|
||||||
|
|
||||||
c.addIncludePath(b.path(rootPath));
|
|
||||||
|
|
||||||
// get all the .c files
|
// get all the .c files
|
||||||
var files = std.ArrayList([]const u8).init(alloc);
|
var files = std.ArrayList([]const u8).init(alloc);
|
||||||
errdefer files.deinit();
|
errdefer files.deinit();
|
||||||
@ -105,7 +103,16 @@ fn compileTheRightLua(b: *std.Build, target: std.Build.ResolvedTarget, version:
|
|||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn build(b: *std.Build) void {
|
fn includeTheRightLua(b: *std.Build, c: *std.Build.Step.Compile, version: LuaVersion) !void {
|
||||||
|
const alloc = b.allocator;
|
||||||
|
const dirName = @tagName(version);
|
||||||
|
|
||||||
|
const rootPath = try std.mem.join(alloc, std.fs.path.sep_str, &.{ "foreign", dirName });
|
||||||
|
|
||||||
|
c.addIncludePath(b.path(rootPath));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn build(b: *std.Build) !void {
|
||||||
const target = b.standardTargetOptions(.{});
|
const target = b.standardTargetOptions(.{});
|
||||||
|
|
||||||
const os = target.result.os.tag;
|
const os = target.result.os.tag;
|
||||||
@ -162,7 +169,7 @@ pub fn build(b: *std.Build) void {
|
|||||||
emulator.linkLibrary(raylib.artifact("raylib"));
|
emulator.linkLibrary(raylib.artifact("raylib"));
|
||||||
}
|
}
|
||||||
|
|
||||||
const luaVer = b.option(LuaVersion, "lua", "The version of Lua to use.") orelse LuaVersion.lua54;
|
const luaVer = b.option(LuaVersion, "lua", "The version of Lua to use.") orelse LuaVersion.lua52;
|
||||||
emulator.addCSourceFiles(.{
|
emulator.addCSourceFiles(.{
|
||||||
.files = &.{
|
.files = &.{
|
||||||
"src/testLuaArch.c",
|
"src/testLuaArch.c",
|
||||||
@ -173,7 +180,8 @@ pub fn build(b: *std.Build) void {
|
|||||||
if(opts.bit32) "-DNN_BIT32" else "",
|
if(opts.bit32) "-DNN_BIT32" else "",
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
const l = compileTheRightLua(b, target, luaVer) catch unreachable;
|
const l = try compileTheRightLua(b, target, luaVer);
|
||||||
|
try includeTheRightLua(b, emulator, luaVer);
|
||||||
|
|
||||||
// forces us to link in everything too
|
// forces us to link in everything too
|
||||||
emulator.addObject(l);
|
emulator.addObject(l);
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#include <lua.h>
|
#include "lua.h"
|
||||||
#include <lualib.h>
|
#include "lualib.h"
|
||||||
#include <lauxlib.h>
|
#include "lauxlib.h"
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user