Summary
Add support for conditional/dynamic default values in options_modules that can depend on build-time variables like optimize mode.
Use Case
I have a leak_detection_level option that should default to different values based on the optimization mode:
"paranoid" in Debug mode (for development)
"disabled" in Release mode (for production)
Currently, I need to manually edit the generated build.zig after each zbuild sync to add this logic:
const default_leak_level: []const u8 = if (optimize == .Debug) "paranoid" else "disabled";
const option_leak_detection_level = b.option([]const u8, "leak_detection_level", "...") orelse default_leak_level;
Summary
Add support for conditional/dynamic default values in options_modules that can depend on build-time variables like optimize mode.
Use Case
I have a leak_detection_level option that should default to different values based on the optimization mode:
"paranoid" in Debug mode (for development)
"disabled" in Release mode (for production)
Currently, I need to manually edit the generated
build.zigafter each zbuild sync to add this logic: