Not-Nik / raylib-zig

Manually tweaked, auto-generated raylib bindings for zig. https://github.com/raysan5/raylib
MIT License
459 stars 101 forks source link

fix project_setup.sh for zig version 0.12.0-dev.1849+bb0f7d55e #74

Closed travisstaloch closed 3 months ago

travisstaloch commented 3 months ago

This is a fix for the following issue. It should not affect 0.11.0 compatibility.

$ zig version
0.12.0-dev.1849+bb0f7d55e
$ git clone git@github.com:Not-Nik/raylib-zig.git
Cloning into 'raylib-zig'...
remote: Enumerating objects: 1314, done.
remote: Counting objects: 100% (330/330), done.
remote: Compressing objects: 100% (119/119), done.
remote: Total 1314 (delta 262), reused 243 (delta 211), pack-reused 984
Receiving objects: 100% (1314/1314), 728.80 KiB | 766.00 KiB/s, done.
Resolving deltas: 100% (813/813), done.
$ cd raylib-zig/
$ ./project_setup.sh raylib-demo
generating project files...
cloning raylib-zig inside of project...
Cloning into 'raylib-zig'...
done.
$ cd raylib-demo/
$ ls
build.zig  build.zig.zon  raylib-zig  src
$ zig build run
/tmp/raylib-zig/raylib-demo/build.zig:8:9: error: local variable is never mutated
    var raylib_math = rl.math.getModule(b, "raylib-zig");
        ^~~~~~~~~~~
/tmp/raylib-zig/raylib-demo/build.zig:8:9: note: consider using 'const'
/tmp/raylib-zig/raylib-demo/build.zig:7:9: error: local variable is never mutated
    var raylib = rl.getModule(b, "raylib-zig");
        ^~~~~~
/tmp/raylib-zig/raylib-demo/build.zig:7:9: note: consider using 'const'
travisstaloch commented 3 months ago

with this patch i am able to zig build run:

Screenshot-7

Not-Nik commented 3 months ago

I'll test if this works with 0.11 later, then I'll merge

travisstaloch commented 3 months ago

Sounds good. I should mention that I did test w/ 0.11 yesterday after reading your message and $ zig build run works fine.