#Advanced Build System

1 messages · Page 1 of 1 (latest)

brittle kestrel
#

Is it possible to add a zig project to my current project as a submodule and have a step that builds its executable and gets the path and exports it for the source to access it at runtime? (i want to spawn it as a process)

light bay
#

you mean like producing something like a list of exectuables and their paths?

brittle kestrel
#

kind of

light bay
#

you have to decide what format that file will have, you have to start constructing the file content in the build script, create a WriteFile step with const write = b.addWriteFile, and put the the content in a file with write.add(path, content);

brittle kestrel
#

can i not pass it as a constant to the executable?

#

so i have 2 projects (one is a submodule in another) parent and child

#

in the parent project on build i want to first build the child, get the executable path and the build the parent with the executable path of the child as a constant accessible from the code

#

this is mainly for easy development

#

for release the two executables will be in the same folder

light bay
#

both are zig projects?

brittle kestrel
#

yes

light bay
#

why not just have the parent include the child via buid.zig.zon?

brittle kestrel
#

i'm not against that

light bay
#

that should be the most straightforward way

brittle kestrel
#

and how do i get the executable path?

#

or preferably have it in the same directory as the parent executable

#

.zig-out/...