zig
zig copied to clipboard
std.Build: fix --release=x when preferred mode set
Currently if the preferred_optimize_mode is set when calling standardOptimizeOption() then --release={safe,fast,small} will be silently ignored in favor of the preffered optimize mode.
This patch changes this behavior to honor the optimize mode chosen with --release={safe,fast,small} but still use the preferred mode for a bare --release flag.
Fixes https://github.com/ziglang/zig/issues/19732
(comment moved to the issue: https://github.com/ziglang/zig/issues/19732#issuecomment-2070872820)
This is already working as intended; discussion continues at #19732.