소스 검색

[build.zig] Fix raygui build when using addRaygui externally (#4027)

When addRaygui is used from an external build, for example in a
bindings project, the build of a generated `raygui.c` fails with
"raylib.h not found" error from the compiler.

I've traced this down to a raylib step not adding its `src/` to the
shared list of include paths using `addIncludePath` but relying on
`addCSourceFiles` `.root` to provide the implicit include path for
raylib proper's own files.

If raygui is later added to the step the compiler won't know where
to look for `raylib.h` and friends and will fail to build.

This change simply adds raylib's `src/` to the include path list.
pull/4074/head
Viktor Pocedulić 1 년 전
committed by GitHub
부모
커밋
eff7b065eb
No known key found for this signature in database GPG 키 ID: B5690EEEBB952194
1개의 변경된 파일1개의 추가작업 그리고 0개의 파일을 삭제
  1. +1
    -0
      src/build.zig

+ 1
- 0
src/build.zig 파일 보기

@ -217,6 +217,7 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.
},
}
raylib.addIncludePath(b.path("src"));
raylib.root_module.addCSourceFiles(.{
.root = b.path("src"),
.files = c_source_files.items,

불러오는 중...
취소
저장