|
|
@ -13,9 +13,9 @@ comptime { |
|
|
|
|
|
|
|
fn setDesktopPlatform(raylib: *std.Build.Step.Compile, platform: PlatformBackend) void { |
|
|
|
switch (platform) { |
|
|
|
.glfw => raylib.defineCMacro("PLATFORM_DESKTOP_GLFW", null), |
|
|
|
.rgfw => raylib.defineCMacro("PLATFORM_DESKTOP_RGFW", null), |
|
|
|
.sdl => raylib.defineCMacro("PLATFORM_DESKTOP_SDL", null), |
|
|
|
.glfw => raylib.root_module.addCMacro("PLATFORM_DESKTOP_GLFW", ""), |
|
|
|
.rgfw => raylib.root_module.addCMacro("PLATFORM_DESKTOP_RGFW", ""), |
|
|
|
.sdl => raylib.root_module.addCMacro("PLATFORM_DESKTOP_SDL", ""), |
|
|
|
else => {}, |
|
|
|
} |
|
|
|
} |
|
|
@ -173,7 +173,7 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std. |
|
|
|
} |
|
|
|
|
|
|
|
if (options.opengl_version != .auto) { |
|
|
|
raylib.defineCMacro(options.opengl_version.toCMacroStr(), null); |
|
|
|
raylib.root_module.addCMacro(options.opengl_version.toCMacroStr(), ""); |
|
|
|
} |
|
|
|
|
|
|
|
raylib.addIncludePath(b.path("src/platforms")); |
|
|
@ -191,7 +191,7 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std. |
|
|
|
try c_source_files.append("src/rglfw.c"); |
|
|
|
|
|
|
|
if (options.linux_display_backend == .X11 or options.linux_display_backend == .Both) { |
|
|
|
raylib.defineCMacro("_GLFW_X11", null); |
|
|
|
raylib.root_module.addCMacro("_GLFW_X11", ""); |
|
|
|
raylib.linkSystemLibrary("GLX"); |
|
|
|
raylib.linkSystemLibrary("X11"); |
|
|
|
raylib.linkSystemLibrary("Xcursor"); |
|
|
@ -211,7 +211,7 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std. |
|
|
|
, .{}); |
|
|
|
@panic("`wayland-scanner` not found"); |
|
|
|
}; |
|
|
|
raylib.defineCMacro("_GLFW_WAYLAND", null); |
|
|
|
raylib.root_module.addCMacro("_GLFW_WAYLAND", ""); |
|
|
|
raylib.linkSystemLibrary("EGL"); |
|
|
|
raylib.linkSystemLibrary("wayland-client"); |
|
|
|
raylib.linkSystemLibrary("xkbcommon"); |
|
|
@ -230,16 +230,16 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std. |
|
|
|
} else { |
|
|
|
if (options.opengl_version == .auto) { |
|
|
|
raylib.linkSystemLibrary("GLESv2"); |
|
|
|
raylib.defineCMacro("GRAPHICS_API_OPENGL_ES2", null); |
|
|
|
raylib.root_module.addCMacro("GRAPHICS_API_OPENGL_ES2", ""); |
|
|
|
} |
|
|
|
|
|
|
|
raylib.linkSystemLibrary("EGL"); |
|
|
|
raylib.linkSystemLibrary("gbm"); |
|
|
|
raylib.linkSystemLibrary2("libdrm", .{ .use_pkg_config = .force }); |
|
|
|
|
|
|
|
raylib.defineCMacro("PLATFORM_DRM", null); |
|
|
|
raylib.defineCMacro("EGL_NO_X11", null); |
|
|
|
raylib.defineCMacro("DEFAULT_BATCH_BUFFER_ELEMENT", "2048"); |
|
|
|
raylib.root_module.addCMacro("PLATFORM_DRM", ""); |
|
|
|
raylib.root_module.addCMacro("EGL_NO_X11", ""); |
|
|
|
raylib.root_module.addCMacro("DEFAULT_BATCH_BUFFER_ELEMENT", ""); |
|
|
|
} |
|
|
|
}, |
|
|
|
.freebsd, .openbsd, .netbsd, .dragonfly => { |
|
|
@ -290,9 +290,9 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std. |
|
|
|
raylib.addIncludePath(dep.path("upstream/emscripten/cache/sysroot/include")); |
|
|
|
} |
|
|
|
|
|
|
|
raylib.defineCMacro("PLATFORM_WEB", null); |
|
|
|
raylib.root_module.addCMacro("PLATFORM_WEB", ""); |
|
|
|
if (options.opengl_version == .auto) { |
|
|
|
raylib.defineCMacro("GRAPHICS_API_OPENGL_ES2", null); |
|
|
|
raylib.root_module.addCMacro("GRAPHICS_API_OPENGL_ES2", ""); |
|
|
|
} |
|
|
|
}, |
|
|
|
else => { |
|
|
|