Skip to content

Commit e23af9d

Browse files
IOKG04alexrp
authored andcommitted
Build.Step.Options: add comptime_float support
It seems to me this was simply forgotten. Or there is some reason I don't know why this code doesn't work for `comptime_float`. For a more comprehensive fix, #24057 is the place to look.
1 parent f3270ce commit e23af9d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/std/Build/Step/Options.zig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ fn printType(
230230
.int,
231231
.comptime_int,
232232
.float,
233+
.comptime_float,
233234
.null,
234235
=> {
235236
if (name) |some| {
@@ -594,6 +595,7 @@ test Options {
594595
options.addOption(?usize, "option2", null);
595596
options.addOption(?usize, "option3", 3);
596597
options.addOption(comptime_int, "option4", 4);
598+
options.addOption(comptime_float, "option5", 5.01);
597599
options.addOption([]const u8, "string", "zigisthebest");
598600
options.addOption(?[]const u8, "optional_string", null);
599601
options.addOption([2][2]u16, "nested_array", nested_array);
@@ -618,6 +620,7 @@ test Options {
618620
\\pub const option2: ?usize = null;
619621
\\pub const option3: ?usize = 3;
620622
\\pub const option4: comptime_int = 4;
623+
\\pub const option5: comptime_float = 5.01;
621624
\\pub const string: []const u8 = "zigisthebest";
622625
\\pub const optional_string: ?[]const u8 = null;
623626
\\pub const nested_array: [2][2]u16 = [2][2]u16 {

0 commit comments

Comments
 (0)