Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[build] Fix Zig raygui build when using addRaygui externally #4027

Merged
merged 1 commit into from
Jun 16, 2024

Conversation

okvik
Copy link
Contributor

@okvik okvik commented Jun 2, 2024

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.

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.
@raysan5 raysan5 changed the title [build.zig] Fix raygui build when using addRaygui externally [build] Fix Zig raygui build when using addRaygui externally Jun 5, 2024
@raysan5
Copy link
Owner

raysan5 commented Jun 5, 2024

@okvik I'm afraid I'm not an expert on Zig build system, someone with more experience than me should review this PR

@raysan5 raysan5 added the help needed - please! I need help with this issue label Jun 5, 2024
@star-tek-mb
Copy link
Contributor

Looks good to me

@Gamer-Kold
Copy link
Contributor

Seems good to me too

@colinwilcox
Copy link

Doesn't addRaygui() add the raygui dep's own src folder as an include path?

@Not-Nik
Copy link
Contributor

Not-Nik commented Jun 14, 2024

It does, but raylib.h isn't in there

@colinwilcox
Copy link

It does, but raylib.h isn't in there

Sorry, brain fade. I get it now. 👍

@raysan5 raysan5 merged commit eff7b06 into raysan5:master Jun 16, 2024
@raysan5
Copy link
Owner

raysan5 commented Jun 16, 2024

@okvik Thanks for the improvement! @Not-Nik @Gamer-Kold @star-tek-mb @colinwilcox thanks for the review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help needed - please! I need help with this issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants