I’m writing a kernel in C and experimenting with Zig for device drivers. I compile Zig files to object files before linking them them together to my kernel.
I’m using a Makefile-based build system and passing defines via -cflags -D__print_serial --. I need to know if these Makefile-provided defines are accessible within @cImport(), or if there’s a different approach for Makefile-based builds.
Supplement: It seems feasible to pass cflags to the translate-C command. Since @CImport will be removed, not following up in @CImport. Currently, the default behavior of calling translate-C in build.zig does not pass cflags, but that’s fine because we can override this part of the logic in build.zig to pass them in.