Hi! I’m trying to debug a build.zig and failing. Is there a way to debug “printf debugging” with build.zigs, IOW, is there a way I could log what values declarations inside my build.zig take? For example, something like this:
Printing to stderr using std.debug.print to printf debug should work. Is it possible that the problem is as simple as that libsokol.root_module.include_dirs is empty and that that’s why none of your print statements are getting hit?
Hah, yeah, that was the problem. Thanks @castholm! And thanks @recombinant too, that probably works too.
What I’m trying to do is I’m linking in the sokol gfx zig package and in addition to using its Zig parts, I’d also like to include some of my C code that uses sokol_gfx.h that I know is included in the sokol package. I just don’t know exactly how to set up include dirs into my own project that’d point to Sokol’s include dirs. I also don’t know if the Sokol package should do something to register all of the .h files somehow in its own build.zig.
But you might be able to include them by manually doing your_exe.root_module.addIncludePath(dep_sokol.path("src/sokol/c")). Try it and let us know if it works.