#using build.zig to build c + assembly project

1 messages · Page 1 of 1 (latest)

lime quarry
#

I have a src/ directory containing both c and assembly files. How can I get all of the files in src and add them all to an exe? should i even be doing this? https://ziggit.dev/t/zig-build-how-to-handle-an-unknown-amount-of-files-in-a-folder/8543/3 says to not iterate a directory since it messes with --watch, but i dont really care about that

#

i know i can use std.Io.Dir.iterate for this but im wondering if there's a better solution that the build system provides

fluid kestrel
#

The Zig build system intentionally doesn't provide a builtin dir enumeration facility. So much implicitness in such a system is a bit against the Zig zen that favors explicitness.

lime quarry
#

so is it fine to iterate the directory

#

the link mentioned writing a script to get the list of files to be used

fluid kestrel
#

There are various ways to approach this. Whatever works for you. Myself I just ls and copy+paste+edit.