Check out the Upgrade Guide here: Move many settings from being per-Compilation to being per-Module by andrewrk · Pull Request #18160 · ziglang/zig · GitHub
In summary, I think you should use something like this:
const target = b.resolveTargetQuery(.{
.cpu_arch = .x86_64,
.os_tag = .uefi,
});
Then you can pass target
to addExecutable
and friends.