Hi! I'm looking at the example platforms in platform-switching, but I don't understand how roc build
can magically detect and compile platforms in C, zig etc. as far as I can see there's no build file, are they hard coded?
how can I modify the build step? for example, in a C platform how do I use a shared lib, include a header, etc.
I've seen an example of compiling the platform and then the roc app separately with --no-link, but I'm wondering if there's a standard way to all this
The build system is mostly a hack rn in the link.rs
file.
If you need more control, you have to use --no-link
and then have another build system deal with things.
ah I see, thanks for the quick reply
Long term, we plan to have platforms have their own build scripts. They will compile into a special format that enable roc to deal with all the rest of the linking without knowing anything about the language the platform is written in.
Related issue https://github.com/roc-lang/roc/issues/6414
Last updated: Jul 05 2025 at 12:14 UTC