Bladeren bron

[build.zig] Leverage `dependencyFromBuildZig` (#4109)

pull/4113/head
InKryption 7 maanden geleden
committed by GitHub
bovenliggende
commit
57b5f11e2a
Geen bekende sleutel gevonden voor deze handtekening in de database GPG sleutel-ID: B5690EEEBB952194
1 gewijzigde bestanden met toevoegingen van 6 en 7 verwijderingen
  1. +6
    -7
      src/build.zig

+ 6
- 7
src/build.zig Bestand weergeven

@ -11,7 +11,7 @@ var raylib_flags_arr: std.ArrayListUnmanaged([]const u8) = .{};
// This has been tested with zig version 0.12.0
pub fn addRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.builtin.OptimizeMode, options: Options) !*std.Build.Step.Compile {
const raylib_dep = b.dependency(options.raylib_dependency_name, .{
const raylib_dep = b.dependencyFromBuildZig(@This(), .{
.target = target,
.optimize = optimize,
.raudio = options.raudio,
@ -257,7 +257,6 @@ pub const Options = struct {
linux_display_backend: LinuxDisplayBackend = .X11,
opengl_version: OpenglVersion = .auto,
raylib_dependency_name: []const u8 = "raylib",
raygui_dependency_name: []const u8 = "raygui",
};
@ -272,11 +271,11 @@ pub const OpenglVersion = enum {
pub fn toCMacroStr(self: @This()) []const u8 {
switch (self) {
.auto => @panic("OpenglVersion.auto cannot be turned into a C macro string"),
.gl_1_1 => return "GRAPHICS_API_OPENGL_11",
.gl_2_1 => return "GRAPHICS_API_OPENGL_21",
.gl_3_3 => return "GRAPHICS_API_OPENGL_33",
.gl_4_3 => return "GRAPHICS_API_OPENGL_43",
.auto => @panic("OpenglVersion.auto cannot be turned into a C macro string"),
.gl_1_1 => return "GRAPHICS_API_OPENGL_11",
.gl_2_1 => return "GRAPHICS_API_OPENGL_21",
.gl_3_3 => return "GRAPHICS_API_OPENGL_33",
.gl_4_3 => return "GRAPHICS_API_OPENGL_43",
.gles_2 => return "GRAPHICS_API_OPENGL_ES2",
.gles_3 => return "GRAPHICS_API_OPENGL_ES3",
}

Laden…
Annuleren
Opslaan