Not-Nik / raylib-zig

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

Use OS specific path separators in `build.zig`, and remove comptime parameters in `getModule`. #57

Open srijan-paul opened 9 months ago

srijan-paul commented 9 months ago

Currently, the build script uses lib/raylib-zig.zig. We should replace that / with a return value from std.fs.path.join.

I also think the TODO comment in build.zig can be addressed without too much trouble. Currently, I'm using trying to write my own build.zig instead of using the setup script, and I have this piece of code in my build script:

const paths = [2][]const u8{ "lib", "raylib-zig" };
const raylib_zig_path = try std.fs.path.join(allocator, &paths);
var raylib = rl.getModule(b, raylib_zig_path);

However, since the second parameter to getModule is comptime, I am unable to pass a runtime value to it.

If this project is open to contributions, I can raise a PR.

srijan-paul commented 9 months ago

I also see that getModuleInternal has a pub qualifier. Perhaps we can get rid of that?

Not-Nik commented 9 months ago

I also see that getModuleInternal has a pub qualifier. Perhaps we can get rid of that?

Did that, thanks for reminding me.

If this project is open to contributions, I can raise a PR.

It definitely is. Feel free to do so.