raylib-zig icon indicating copy to clipboard operation
raylib-zig copied to clipboard

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

Open srijan-paul opened this issue 2 years ago • 2 comments

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 avatar Oct 10 '23 18:10 srijan-paul

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

srijan-paul avatar Oct 10 '23 18:10 srijan-paul

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.

Not-Nik avatar Oct 11 '23 11:10 Not-Nik

Seems to me the seperator issue doesn't really pose a problem as Windows recognises both versions, and the rest is fixed. Closing this

Not-Nik avatar Jul 27 '24 21:07 Not-Nik