I want to know if there is a way to check a system dependency exists in build.zig so I can select the appropriate backends in my engine. There is std.zig.PkgConfig but that seems brittle and not cross-platform.
Instead of automagically using a system dependency if available, just give the person building a flag to chose themselves as they may not want to use or something.
The build system as a separate category of flags specifically for this via b.systemIntegrationOption with the flags -fsys/-fsys=name and -fno-sys/-fno-sys=name
The options available are in zig build --help under the “System Integration Options” section
I do give flags and ways to configure these backends (in many ways), but my main goal is to make the default path “just work”.
Though I did not know about this, seems useful.
then dont use system dependencies by default unless they’re unavoidable