mirror of
https://github.com/Not-Nik/raylib-zig.git
synced 2025-09-09 12:07:27 +00:00
Fix build with raygui (#98)
This commit is contained in:
parent
a968200aaf
commit
533c31321a
19
build.zig
19
build.zig
@ -107,10 +107,25 @@ fn getRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.buil
|
||||
|
||||
const lib = raylib.artifact("raylib");
|
||||
|
||||
rl.addRaygui(b, lib, b.dependency("raygui", .{
|
||||
const raygui_dep = b.dependency("raygui", .{
|
||||
.target = target,
|
||||
.optimize = optimize,
|
||||
}));
|
||||
});
|
||||
|
||||
var gen_step = b.addWriteFiles();
|
||||
lib.step.dependOn(&gen_step.step);
|
||||
|
||||
const raygui_c_path = gen_step.add("raygui.c", "#define RAYGUI_IMPLEMENTATION\n#include \"raygui.h\"\n");
|
||||
lib.addCSourceFile(.{ .file = raygui_c_path, .flags = &[_][]const u8{
|
||||
"-std=gnu99",
|
||||
"-D_GNU_SOURCE",
|
||||
"-DGL_SILENCE_DEPRECATION=199309L",
|
||||
"-fno-sanitize=undefined", // https://github.com/raysan5/raylib/issues/3674
|
||||
}});
|
||||
lib.addIncludePath(raylib.path("src"));
|
||||
lib.addIncludePath(raygui_dep.path("src"));
|
||||
|
||||
lib.installHeader(raygui_dep.path("src/raygui.h"), "raygui.h");
|
||||
|
||||
b.installArtifact(lib);
|
||||
_raylib_lib_cache = lib;
|
||||
|
@ -8,7 +8,7 @@
|
||||
},
|
||||
.raygui = .{
|
||||
.url = "https://github.com/raysan5/raygui/archive/4b3d94f5df6a5a2aa86286350f7e20c0ca35f516.tar.gz",
|
||||
.hash = "12205f45151f556dd41348acc8a93099f19d6a2e830978ace86733ce0bfe52978812",
|
||||
.hash = "122002d98ca255ec706ef8e5497b3723d6c6e163511761d116dac3aee87747d46cf1",
|
||||
}
|
||||
},
|
||||
.minimum_zig_version = "0.12.0",
|
||||
|
Loading…
x
Reference in New Issue
Block a user