#What are modules? And how do i create them?
1 messages · Page 1 of 1 (latest)
I am using the master build of zig
I do not know what to put for FileSource generated member
What are modules? And how do i create them?
I found this post to be helpful https://discord.com/channels/605571803288698900/1082181789612781578
Did you work it out?
A module is a tree of zig files with an main/entry-point file used to for importing like @import("module-name"); To make one in a build.zig you use either std.Build.createModule(), std.Build.addModule() or std.Build.CompileStep.addAnonymousModule(). The above snippet isn't quite enough to know what is going wrong, but it looks like you're trying to create a module by using std.Build.CompileStep.addModule(), which is not used for creating a module, but rather for making one accessible under a given name in another zig module. You'll either want to use addAnonymousModule() or create a module separately and then pass that instead of the anonymous struct in you snippet.