@@ -20,10 +20,10 @@ pub fn build(b: *Builder) !void {
20
20
const rel_zig_exe = try fs .path .relative (b .allocator , b .build_root , b .zig_exe );
21
21
const langref_out_path = fs .path .join (
22
22
b .allocator ,
23
- [_ ][]const u8 { b .cache_root , "langref.html" },
23
+ & [_ ][]const u8 { b .cache_root , "langref.html" },
24
24
) catch unreachable ;
25
25
var docgen_cmd = docgen_exe .run ();
26
- docgen_cmd .addArgs ([_ ][]const u8 {
26
+ docgen_cmd .addArgs (& [_ ][]const u8 {
27
27
rel_zig_exe ,
28
28
"doc" ++ fs .path .sep_str ++ "langref.html.in" ,
29
29
langref_out_path ,
@@ -36,7 +36,7 @@ pub fn build(b: *Builder) !void {
36
36
const test_step = b .step ("test" , "Run all the tests" );
37
37
38
38
// find the stage0 build artifacts because we're going to re-use config.h and zig_cpp library
39
- const build_info = try b .exec ([_ ][]const u8 {
39
+ const build_info = try b .exec (& [_ ][]const u8 {
40
40
b .zig_exe ,
41
41
"BUILD_INFO" ,
42
42
});
@@ -56,7 +56,7 @@ pub fn build(b: *Builder) !void {
56
56
test_stage2 .setBuildMode (builtin .Mode .Debug );
57
57
test_stage2 .addPackagePath ("stage2_tests" , "test/stage2/test.zig" );
58
58
59
- const fmt_build_zig = b .addFmt ([_ ][]const u8 {"build.zig" });
59
+ const fmt_build_zig = b .addFmt (& [_ ][]const u8 {"build.zig" });
60
60
61
61
var exe = b .addExecutable ("zig" , "src-self-hosted/main.zig" );
62
62
exe .setBuildMode (mode );
@@ -88,7 +88,7 @@ pub fn build(b: *Builder) !void {
88
88
.source_dir = "lib" ,
89
89
.install_dir = .Lib ,
90
90
.install_subdir = "zig" ,
91
- .exclude_extensions = [_ ][]const u8 { "test.zig" , "README.md" },
91
+ .exclude_extensions = & [_ ][]const u8 { "test.zig" , "README.md" },
92
92
});
93
93
94
94
const test_filter = b .option ([]const u8 , "test-filter" , "Skip tests that do not match filter" );
@@ -148,7 +148,7 @@ fn dependOnLib(b: *Builder, lib_exe_obj: var, dep: LibraryDep) void {
148
148
}
149
149
const lib_dir = fs .path .join (
150
150
b .allocator ,
151
- [_ ][]const u8 { dep .prefix , "lib" },
151
+ & [_ ][]const u8 { dep .prefix , "lib" },
152
152
) catch unreachable ;
153
153
for (dep .system_libs .toSliceConst ()) | lib | {
154
154
const static_bare_name = if (mem .eql (u8 , lib , "curses" ))
@@ -157,7 +157,7 @@ fn dependOnLib(b: *Builder, lib_exe_obj: var, dep: LibraryDep) void {
157
157
b .fmt ("lib{}.a" , lib );
158
158
const static_lib_name = fs .path .join (
159
159
b .allocator ,
160
- [_ ][]const u8 { lib_dir , static_bare_name },
160
+ & [_ ][]const u8 { lib_dir , static_bare_name },
161
161
) catch unreachable ;
162
162
const have_static = fileExists (static_lib_name ) catch unreachable ;
163
163
if (have_static ) {
@@ -183,7 +183,7 @@ fn fileExists(filename: []const u8) !bool {
183
183
}
184
184
185
185
fn addCppLib (b : * Builder , lib_exe_obj : var , cmake_binary_dir : []const u8 , lib_name : []const u8 ) void {
186
- lib_exe_obj .addObjectFile (fs .path .join (b .allocator , [_ ][]const u8 {
186
+ lib_exe_obj .addObjectFile (fs .path .join (b .allocator , & [_ ][]const u8 {
187
187
cmake_binary_dir ,
188
188
"zig_cpp" ,
189
189
b .fmt ("{}{}{}" , lib_exe_obj .target .libPrefix (), lib_name , lib_exe_obj .target .staticLibSuffix ()),
@@ -199,22 +199,22 @@ const LibraryDep = struct {
199
199
};
200
200
201
201
fn findLLVM (b : * Builder , llvm_config_exe : []const u8 ) ! LibraryDep {
202
- const shared_mode = try b .exec ([_ ][]const u8 { llvm_config_exe , "--shared-mode" });
202
+ const shared_mode = try b .exec (& [_ ][]const u8 { llvm_config_exe , "--shared-mode" });
203
203
const is_static = mem .startsWith (u8 , shared_mode , "static" );
204
204
const libs_output = if (is_static )
205
- try b .exec ([_ ][]const u8 {
205
+ try b .exec (& [_ ][]const u8 {
206
206
llvm_config_exe ,
207
207
"--libfiles" ,
208
208
"--system-libs" ,
209
209
})
210
210
else
211
- try b .exec ([_ ][]const u8 {
211
+ try b .exec (& [_ ][]const u8 {
212
212
llvm_config_exe ,
213
213
"--libs" ,
214
214
});
215
- const includes_output = try b .exec ([_ ][]const u8 { llvm_config_exe , "--includedir" });
216
- const libdir_output = try b .exec ([_ ][]const u8 { llvm_config_exe , "--libdir" });
217
- const prefix_output = try b .exec ([_ ][]const u8 { llvm_config_exe , "--prefix" });
215
+ const includes_output = try b .exec (& [_ ][]const u8 { llvm_config_exe , "--includedir" });
216
+ const libdir_output = try b .exec (& [_ ][]const u8 { llvm_config_exe , "--libdir" });
217
+ const prefix_output = try b .exec (& [_ ][]const u8 { llvm_config_exe , "--prefix" });
218
218
219
219
var result = LibraryDep {
220
220
.prefix = mem .tokenize (prefix_output , " \r \n " ).next ().? ,
@@ -341,7 +341,7 @@ fn addCxxKnownPath(
341
341
objname : []const u8 ,
342
342
errtxt : ? []const u8 ,
343
343
) ! void {
344
- const path_padded = try b .exec ([_ ][]const u8 {
344
+ const path_padded = try b .exec (& [_ ][]const u8 {
345
345
ctx .cxx_compiler ,
346
346
b .fmt ("-print-file-name={}" , objname ),
347
347
});
0 commit comments