Merge pull request #24 from speedy-lex/fix-raylib-build

Revert "raylib submodule -> zig dependency"
This commit is contained in:
Quantum Tomato 2025-10-01 17:29:29 +02:00 committed by GitHub
commit eefc7281bd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 36 additions and 31 deletions

3
.gitmodules vendored
View File

@ -10,3 +10,6 @@
path = foreign/lua54
url = https://github.com/lua/lua
branch = v5.4
[submodule "foreign/raylib"]
path = foreign/raylib
url = https://github.com/raysan5/raylib

View File

@ -82,6 +82,22 @@ const LuaVersion = enum {
lua54,
};
fn compileRaylib(b: *std.Build, os: std.Target.Os.Tag, c: *std.Build.Step.Compile) void {
// TODO: find out how to send our target to this build cmd
const raylib = b.addSystemCommand(&.{ "zig", "build" });
raylib.setCwd(b.path("foreign/raylib/"));
raylib.stdio = .inherit;
c.step.dependOn(&raylib.step);
c.addIncludePath(b.path("foreign/raylib/zig-out/include/"));
c.addLibraryPath(b.path("foreign/raylib/zig-out/lib/"));
c.linkSystemLibrary("raylib");
if (os == .windows) {
c.linkSystemLibrary("WinMM");
c.linkSystemLibrary("GDI32");
}
}
// For the test architecture, we specify the target Lua version we so desire.
// This can be checked for with Lua's _VERSION
@ -191,9 +207,7 @@ pub fn build(b: *std.Build) !void {
if (sysraylib_flag) {
emulator.linkSystemLibrary("raylib");
} else {
const raylib = b.dependency("raylib", .{ .target = target, .optimize = optimize });
emulator.addIncludePath(raylib.path(raylib.builder.h_dir));
emulator.linkLibrary(raylib.artifact("raylib"));
compileRaylib(b, os, emulator);
}
const luaVer = b.option(LuaVersion, "lua", "The version of Lua to use.") orelse LuaVersion.lua53;

View File

@ -1,13 +0,0 @@
.{
.name = .neonucleus,
.fingerprint = 0xc9c7605b6b82f1a7,
.version = "0.0.1",
.paths = .{ "data", "build.zig", "build.zig.zon", "src" },
.dependencies = .{
.raylib = .{
.url = "https://github.com/raysan5/raylib/archive/46f01e315d07d0b1fedd1a3c388d1acaa9f6ccd6.tar.gz",
.hash = "raylib-5.5.0-whq8uO5uNgRDK_yuN0AGftGhWSVyctgPQNALENrZHt3k",
},
},
}

1
foreign/raylib Submodule

@ -0,0 +1 @@
Subproject commit 6f1077737e48d447380cf5573adf1394dfe3aac6