From da5ae3710dfef0e62c253f232fbb0b9949babd63 Mon Sep 17 00:00:00 2001 From: Fabien Freling Date: Wed, 4 Oct 2023 16:03:06 +0200 Subject: [PATCH] use zig packaging for raylib --- .gitmodules | 3 --- zig/3rd-party/raylib | 1 - zig/build.zig | 4 ++-- zig/build.zig.zon | 10 ++++++++++ 4 files changed, 12 insertions(+), 6 deletions(-) delete mode 160000 zig/3rd-party/raylib create mode 100644 zig/build.zig.zon diff --git a/.gitmodules b/.gitmodules index ec6a971..ff8ced2 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,3 @@ -[submodule "zig/3rd-party/raylib"] - path = zig/3rd-party/raylib - url = https://github.com/raysan5/raylib/ [submodule "zig/3rd-party/raygui"] path = zig/3rd-party/raygui url = https://github.com/raysan5/raygui/ diff --git a/zig/3rd-party/raylib b/zig/3rd-party/raylib deleted file mode 160000 index bc15c19..0000000 --- a/zig/3rd-party/raylib +++ /dev/null @@ -1 +0,0 @@ -Subproject commit bc15c19518968878b68bbfe8eac3fe4297f11770 diff --git a/zig/build.zig b/zig/build.zig index 232cf3e..b4d4a33 100644 --- a/zig/build.zig +++ b/zig/build.zig @@ -16,12 +16,12 @@ pub fn build(b: *std.Build) void { // We cannot directly use modules since v4.5 is not compatible with zig // v0.11 - const raylib_dep = b.anonymousDependency("3rd-party/raylib/", @import("3rd-party/raylib/build.zig"), .{ + const raylib_dep = b.dependency("raylib", .{ .target = target, .optimize = optimize, }); - exe.addIncludePath(.{ .path = "3rd-party/raygui/src" }); exe.linkLibrary(raylib_dep.artifact("raylib")); + exe.addIncludePath(.{ .path = "3rd-party/raygui/src" }); exe.linkSystemLibrary("sqlite3"); // This declares intent for the executable to be installed into the diff --git a/zig/build.zig.zon b/zig/build.zig.zon new file mode 100644 index 0000000..346fb45 --- /dev/null +++ b/zig/build.zig.zon @@ -0,0 +1,10 @@ +.{ + .name = "fabapp", + .version = "0.1.0", + .dependencies = .{ + .raylib = .{ + .url = "https://github.com/raysan5/raylib/archive/bc15c19518968878b68bbfe8eac3fe4297f11770.tar.gz", + .hash = "122093954b8c911e507de32d83a2046e122c6aca64e71f5244d54f9bbb93730c3ab7", + }, + }, +}