@@ -2,7 +2,6 @@ const std = @import("std");
2
2
const builtin = @import ("builtin" );
3
3
4
4
pub fn build (b : * std.Build ) ! void {
5
-
6
5
const target = b .standardTargetOptions (.{});
7
6
const optimize = b .standardOptimizeOption (.{});
8
7
@@ -23,7 +22,7 @@ pub fn build(b: *std.Build) !void {
23
22
{
24
23
const exe = b .addExecutable (.{
25
24
.name = "test" ,
26
- .root_source_file = .{ . path = "test.zig" } ,
25
+ .root_source_file = b . path ( "test.zig" ) ,
27
26
.target = target ,
28
27
.optimize = optimize ,
29
28
});
@@ -87,7 +86,7 @@ fn addZigupExe(
87
86
if (target .result .os .tag == .windows ) {
88
87
const exe = b .addExecutable (.{
89
88
.name = "win32exelink" ,
90
- .root_source_file = .{ . path = "win32exelink.zig" } ,
89
+ .root_source_file = b . path ( "win32exelink.zig" ) ,
91
90
.target = target ,
92
91
.optimize = optimize ,
93
92
});
@@ -100,7 +99,7 @@ fn addZigupExe(
100
99
101
100
const exe = b .addExecutable (.{
102
101
.name = "zigup" ,
103
- .root_source_file = .{ . path = "zigup.zig" } ,
102
+ .root_source_file = b . path ( "zigup.zig" ) ,
104
103
.target = target ,
105
104
.optimize = optimize ,
106
105
});
@@ -117,7 +116,7 @@ fn ci(
117
116
test_step : * std.Build.Step ,
118
117
host_zip_exe : * std.Build.Step.Compile ,
119
118
) ! void {
120
- const ci_targets = [_ ][]const u8 {
119
+ const ci_targets = [_ ][]const u8 {
121
120
"x86_64-linux" ,
122
121
"x86_64-macos" ,
123
122
"x86_64-windows" ,
@@ -140,8 +139,7 @@ fn ci(
140
139
));
141
140
const optimize : std.builtin.OptimizeMode =
142
141
// Compile in ReleaseSafe on Windows for faster extraction
143
- if (target .result .os .tag == .windows ) .ReleaseSafe
144
- else .Debug ;
142
+ if (target .result .os .tag == .windows ) .ReleaseSafe else .Debug ;
145
143
const zigup_exe = addZigupExe (b , target , optimize );
146
144
const zigup_exe_install = b .addInstallArtifact (zigup_exe , .{
147
145
.dest_dir = .{ .override = .{ .custom = ci_target_str } },
@@ -150,7 +148,7 @@ fn ci(
150
148
151
149
const test_exe = b .addExecutable (.{
152
150
.name = b .fmt ("test-{s}" , .{ci_target_str }),
153
- .root_source_file = .{ . path = "test.zig" } ,
151
+ .root_source_file = b . path ( "test.zig" ) ,
154
152
.target = target ,
155
153
.optimize = optimize ,
156
154
});
@@ -172,9 +170,7 @@ fn ci(
172
170
}
173
171
174
172
if (builtin .os .tag == .linux ) {
175
- make_archive_step .dependOn (makeCiArchiveStep (
176
- b , ci_target_str , target .result , zigup_exe_install , host_zip_exe
177
- ));
173
+ make_archive_step .dependOn (makeCiArchiveStep (b , ci_target_str , target .result , zigup_exe_install , host_zip_exe ));
178
174
}
179
175
}
180
176
}
@@ -197,10 +193,10 @@ fn makeCiArchiveStep(
197
193
zip .addArg (out_zip_file );
198
194
zip .addArg ("zigup.exe" );
199
195
zip .addArg ("zigup.pdb" );
200
- zip .cwd = .{ .path = b .getInstallPath (
196
+ zip .cwd = .{ .cwd_relative = b .getInstallPath (
201
197
exe_install .dest_dir .? ,
202
198
"." ,
203
- )};
199
+ ) };
204
200
zip .step .dependOn (& exe_install .step );
205
201
return & zip .step ;
206
202
}
@@ -215,10 +211,10 @@ fn makeCiArchiveStep(
215
211
targz ,
216
212
"zigup" ,
217
213
});
218
- tar .cwd = .{ .path = b .getInstallPath (
214
+ tar .cwd = .{ .cwd_relative = b .getInstallPath (
219
215
exe_install .dest_dir .? ,
220
216
"." ,
221
- )};
217
+ ) };
222
218
tar .step .dependOn (& exe_install .step );
223
219
return & tar .step ;
224
220
}
0 commit comments