@@ -45,7 +45,6 @@ pub fn build(b: *std.Build) !void {
45
45
.{ .name = "options" , .module = options_module },
46
46
.{ .name = "zwindows" , .module = zwindows_module },
47
47
},
48
-
49
48
});
50
49
}
51
50
@@ -226,14 +225,6 @@ pub const CompileShaders = struct {
226
225
self .zwindows .path ("bin/x64" ).getPath (b ),
227
226
);
228
227
}
229
-
230
- switch (builtin .target .os .tag ) {
231
- .linux , .macos = > {
232
- const chmod = b .addSystemCommand (&.{ "chmod" , "+x" , dxc_path });
233
- cmd_step .step .dependOn (& chmod .step );
234
- },
235
- else = > {},
236
- }
237
228
238
229
self .step .dependOn (& cmd_step .step );
239
230
}
@@ -245,8 +236,23 @@ pub fn addCompileShaders(
245
236
zwindows : * std.Build.Dependency ,
246
237
options : struct { shader_ver : []const u8 },
247
238
) CompileShaders {
239
+ const build_shaders = b .step (name ++ "-dxc" , "Build shaders for '" ++ name ++ "'" );
240
+
241
+ const dxc_path = switch (builtin .target .os .tag ) {
242
+ .windows = > zwindows .path ("bin/x64/dxc.exe" ).getPath (b ),
243
+ .linux = > zwindows .path ("bin/x64/dxc" ).getPath (b ),
244
+ else = > @panic ("Unsupported target" ),
245
+ };
246
+ switch (builtin .target .os .tag ) {
247
+ .linux , .macos = > {
248
+ const chmod = b .addSystemCommand (&.{ "chmod" , "+x" , dxc_path });
249
+ build_shaders .dependOn (& chmod .step );
250
+ },
251
+ else = > {},
252
+ }
253
+
248
254
return .{
249
- .step = b . step ( name ++ "-dxc" , "Build shaders for '" ++ name ++ "'" ) ,
255
+ .step = build_shaders ,
250
256
.zwindows = zwindows ,
251
257
.shader_ver = options .shader_ver ,
252
258
};
0 commit comments