add C-flags from raylib

zig
Fabien Freling 2022-05-03 16:42:11 +02:00
parent cc8498feba
commit d2d6e5512e
2 changed files with 7 additions and 24 deletions

View File

@ -20,7 +20,13 @@ pub fn build(b: *std.build.Builder) void {
exe.addIncludeDir("3rdparty/raylib/src");
exe.addIncludeDir("3rdparty/raygui/src");
exe.addIncludeDir("3rdparty/raygui/examples");
exe.addCSourceFile("src/raylib.c", &[_][]u8{});
const raylib_flags = &[_][]const u8{
"-std=gnu99",
"-DPLATFORM_DESKTOP",
"-DGL_SILENCE_DEPRECATION=199309L",
"-fno-sanitize=undefined",
};
exe.addCSourceFile("src/raylib.c", raylib_flags);
exe.setBuildMode(mode);
exe.install();

View File

@ -1,23 +0,0 @@
const std = @import("std");
const r = @import("raylib.zig");
pub fn main() anyerror!void {
r.InitWindow(800, 450, "doggo");
defer r.CloseWindow();
while (!r.WindowShouldClose()) {
// Draw
r.BeginDrawing();
defer r.EndDrawing();
r.ClearBackground(r.RAYWHITE);
_ = r.GuiMessageBox(
r.Rectangle{ .x = 0, .y = 0, .width = 200, .height = 200 },
"Message Box Title",
"Message content",
null,
);
}
}