@@ -81,25 +81,56 @@ pub fn build(b: *std.Build) !void {
81
81
82
82
if (all_specified_optional != all_specified ) return error .TestFailed ;
83
83
84
+ const all_specified_literal = b .dependency ("other" , .{
85
+ .target = b .resolveTargetQuery (.{ .cpu_arch = .x86_64 , .os_tag = .windows , .abi = .gnu }),
86
+ .optimize = .ReleaseSafe ,
87
+ .bool = true ,
88
+ .int = 123 ,
89
+ .float = 0.5 ,
90
+ .string = "abc" ,
91
+ .string_list = &[_ ][]const u8 { "a" , "b" , "c" },
92
+ .lazy_path = @as (std .Build .LazyPath , .{ .cwd_relative = "abc.txt" }),
93
+ .lazy_path_list = &[_ ]std.Build.LazyPath {
94
+ .{ .cwd_relative = "a.txt" },
95
+ .{ .cwd_relative = "b.txt" },
96
+ .{ .cwd_relative = "c.txt" },
97
+ },
98
+ .@"enum" = .alfa ,
99
+ //.enum_list = &[_]Enum{ .alfa, .bravo, .charlie },
100
+ //.build_id = @as(std.zig.BuildId, .uuid),
101
+ });
102
+
103
+ if (all_specified_literal != all_specified ) return error .TestFailed ;
104
+
105
+ var mut_string_buf = "abc" .* ;
106
+ const mut_string : []u8 = & mut_string_buf ;
107
+ var mut_string_list_buf = [_ ][]const u8 { "a" , "b" , "c" };
108
+ const mut_string_list : [][]const u8 = & mut_string_list_buf ;
109
+ var mut_lazy_path_list_buf = [_ ]std.Build.LazyPath {
110
+ .{ .cwd_relative = "a.txt" },
111
+ .{ .cwd_relative = "b.txt" },
112
+ .{ .cwd_relative = "c.txt" },
113
+ };
114
+ const mut_lazy_path_list : []std.Build.LazyPath = & mut_lazy_path_list_buf ;
115
+ var mut_enum_list_buf = [_ ]Enum { .alfa , .bravo , .charlie };
116
+ const mut_enum_list : []Enum = & mut_enum_list_buf ;
117
+ _ = mut_enum_list ;
118
+
84
119
// Most supported option types are serialized to a string representation,
85
120
// so alternative representations of the same option value should resolve
86
121
// to the same cached dependency instance.
87
122
const all_specified_alt = b .dependency ("other" , .{
88
123
.target = @as (std .Target .Query , .{ .cpu_arch = .x86_64 , .os_tag = .windows , .abi = .gnu }),
89
- .optimize = @as ([] const u8 , "ReleaseSafe" ) ,
124
+ .optimize = "ReleaseSafe" ,
90
125
.bool = .true ,
91
- .int = @as ([] const u8 , "123" ) ,
126
+ .int = "123" ,
92
127
.float = @as (f16 , 0.5 ),
93
- .string = .abc ,
94
- .string_list = @as ([] const [] const u8 , &.{ "a" , "b" , "c" }) ,
128
+ .string = mut_string ,
129
+ .string_list = mut_string_list ,
95
130
.lazy_path = @as (std .Build .LazyPath , .{ .cwd_relative = "abc.txt" }),
96
- .lazy_path_list = @as ([]const std .Build .LazyPath , &.{
97
- .{ .cwd_relative = "a.txt" },
98
- .{ .cwd_relative = "b.txt" },
99
- .{ .cwd_relative = "c.txt" },
100
- }),
101
- .@"enum" = @as ([]const u8 , "alfa" ),
102
- //.enum_list = @as([]const Enum, &.{ .alfa, .bravo, .charlie }),
131
+ .lazy_path_list = mut_lazy_path_list ,
132
+ .@"enum" = "alfa" ,
133
+ //.enum_list = mut_enum_list,
103
134
//.build_id = @as(std.zig.BuildId, .uuid),
104
135
});
105
136
0 commit comments