Adapt build.zig to redesigned raylib build features config system#5645
Adapt build.zig to redesigned raylib build features config system#5645raysan5 merged 1 commit intoraysan5:masterfrom
Conversation
|
Hi @Wertual08, I ended up also opening a PR that ends up tackling the same issue in parsing |
|
I was taking a look at it, and the black screen in zig master is probably because not all macros are included and also don't have their default values included in the try raylib_flags_arr.append(b.allocator, "-DMACRO"); statements. As far as I understand, not using a value was compatible with the previous config system where only defined(MACRO) was used, so now we need to also pass the value, correct? (ex.: -DMACRO=1) |
|
Yeah, but new config.h already provides meaningfull default values, so why parse it to override them with the same ones? |
|
I am not entirely familiar with the build process, so I could be missing something obvious, but I feel like like the default values are not being propagated the way you think they are? For example, I managed to find exactly what makes
If you add this, the example now works! Using I think your approach is good, I just think we need to validate with zig master. |
|
Thanks, I`ll check this out today. |
|
Actually, I am sorry, I ended up using the |
|
Oh, no problem! Thanks you very much for testing my PR. I was surprised, because I tried it on two systems, but now we came to agreement. Thanks for your time! |
|
@Wertual08 @felipeasimos thanks for the improvement and further reviews! |
Hello, It`s my first time submitting the PR, so, sorry to waste you time if it does not worth to be merged...
Problem:
Since commit 5361265 raylib config system was redesigned, and current build.zig stopped working at all by providing empty defines. Furthermore, I believe that with new config system there is no need to parse config.h to extract default defines.
Solution:
I removed default config.h parsing and replaced passing -D flags with appropriate addCMacro build call.
Overriding default values can now be done by users as in example below instead of passing options.config which seemed to me like a crutch O_o
I`ve tested building of my projects on Windows 11 and latest Linux arch.
Thanks you very much in advance for your time. Hope this will be helpful...