Support conditional default values for options based on optimize mode
- Dominant language
- Zig
- Stars
- 12
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
**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:
```zig
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;
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.