瀏覽代碼

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

pull/4113/head
InKryption 7 月之前
committed by GitHub
父節點
當前提交
57b5f11e2a
沒有發現已知的金鑰在資料庫的簽署中 GPG 金鑰 ID: B5690EEEBB952194
共有 1 個檔案被更改,包括 6 行新增7 行删除
  1. +6
    -7
      src/build.zig

+ 6
- 7
src/build.zig 查看文件

@ -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",
}

Loading…
取消
儲存