Kaynağa Gözat

[build.zig] pass the real build.zig file (#4113)

`@This()` was naively passed to `dependencyFromBuildZig` while inside
a file that is not actually the build file, causing a panic when
actually used. Passing `@import("../build.zig")` fixes this.
pull/4117/head
InKryption 7 ay önce
işlemeyi yapan: GitHub
ebeveyn
işleme
5e91444e3e
Veri tabanında bu imza için bilinen anahtar bulunamadı GPG Anahtar Kimliği: B5690EEEBB952194
1 değiştirilmiş dosya ile 6 ekleme ve 1 silme
  1. +6
    -1
      src/build.zig

+ 6
- 1
src/build.zig Dosyayı Görüntüle

@ -9,9 +9,14 @@ comptime {
// get the flags a second time when adding raygui
var raylib_flags_arr: std.ArrayListUnmanaged([]const u8) = .{};
/// we're not inside the actual build script recognized by the
/// zig build system; use this type where one would otherwise
/// use `@This()` when inside the actual entrypoint file.
const BuildScript = @import("../build.zig");
// 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.dependencyFromBuildZig(@This(), .{
const raylib_dep = b.dependencyFromBuildZig(BuildScript, .{
.target = target,
.optimize = optimize,
.raudio = options.raudio,

Yükleniyor…
İptal
Kaydet