mirror of
https://github.com/raysan5/raylib.git
synced 2025-10-04 17:06:27 +00:00
The changes brought by #3891 uses `std.process.Child.run` which was renamed from `std.process.Child.exec` in Zig version 0.11.0. This commit adds a version check to use the appropriate function names. Additionally, the `linux_display_backend` configuration option is added so users can set it when running `zig build` with the `-D` option or when using raylib as a dependency.
This commit is contained in:
@@ -254,6 +254,7 @@ pub fn build(b: *std.Build) !void {
|
|||||||
.rshapes = b.option(bool, "rshapes", "Compile with shapes support") orelse defaults.rshapes,
|
.rshapes = b.option(bool, "rshapes", "Compile with shapes support") orelse defaults.rshapes,
|
||||||
.raygui = b.option(bool, "raygui", "Compile with raygui support") orelse defaults.raygui,
|
.raygui = b.option(bool, "raygui", "Compile with raygui support") orelse defaults.raygui,
|
||||||
.shared = b.option(bool, "shared", "Compile as shared library") orelse defaults.shared,
|
.shared = b.option(bool, "shared", "Compile as shared library") orelse defaults.shared,
|
||||||
|
.linux_display_backend = b.option(LinuxDisplayBackend, "linux_display_backend", "Linux display backend to use") orelse defaults.linux_display_backend,
|
||||||
};
|
};
|
||||||
|
|
||||||
const lib = try addRaylib(b, target, optimize, options);
|
const lib = try addRaylib(b, target, optimize, options);
|
||||||
@@ -306,24 +307,28 @@ fn addCSourceFilesVersioned(
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn waylandGenerate(allocator: std.mem.Allocator, comptime protocol: []const u8, comptime basename: []const u8) !void {
|
fn waylandGenerate(allocator: std.mem.Allocator, comptime protocol: []const u8, comptime basename: []const u8) !void {
|
||||||
_ = try std.process.Child.run(.{
|
const protocolDir = waylandDir ++ "/" ++ protocol;
|
||||||
.allocator = allocator,
|
const clientHeader = srcdir ++ "/" ++ basename ++ ".h";
|
||||||
.argv = &[_][]const u8{
|
const privateCode = srcdir ++ "/" ++ basename ++ "-code.h";
|
||||||
"wayland-scanner",
|
if (comptime builtin.zig_version.minor >= 12) {
|
||||||
"client-header",
|
_ = try std.process.Child.run(.{
|
||||||
waylandDir ++ "/" ++ protocol,
|
.allocator = allocator,
|
||||||
srcdir ++ "/" ++ basename ++ ".h",
|
.argv = &[_][]const u8{ "wayland-scanner", "client-header", protocolDir, clientHeader },
|
||||||
},
|
});
|
||||||
});
|
_ = try std.process.Child.run(.{
|
||||||
_ = try std.process.Child.run(.{
|
.allocator = allocator,
|
||||||
.allocator = allocator,
|
.argv = &[_][]const u8{ "wayland-scanner", "private-code", protocolDir, privateCode },
|
||||||
.argv = &[_][]const u8{
|
});
|
||||||
"wayland-scanner",
|
} else {
|
||||||
"private-code",
|
_ = try std.process.Child.exec(.{
|
||||||
waylandDir ++ "/" ++ protocol,
|
.allocator = allocator,
|
||||||
srcdir ++ "/" ++ basename ++ "-code.h",
|
.argv = &[_][]const u8{ "wayland-scanner", "client-header", protocolDir, clientHeader },
|
||||||
},
|
});
|
||||||
});
|
_ = try std.process.Child.exec(.{
|
||||||
|
.allocator = allocator,
|
||||||
|
.argv = &[_][]const u8{ "wayland-scanner", "private-code", protocolDir, privateCode },
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn join2(allocator: std.mem.Allocator, path1: []const u8, path2: []const u8) ![]u8 {
|
fn join2(allocator: std.mem.Allocator, path1: []const u8, path2: []const u8) ![]u8 {
|
||||||
|
Reference in New Issue
Block a user