@@ -79,7 +79,7 @@ pub fn build(b: *std.Build) !void {
79
79
const target = b .standardTargetOptions (.{});
80
80
const optimize = b .standardOptimizeOption (.{});
81
81
const platform = b .option ([]const u8 , "platform" , "Plaftorm to use: sdl or sokol" ) orelse "sdl" ;
82
- const is_sdl_platform = ! std .mem .eql (u8 , platform , "sokol" );
82
+ const is_sdl_platform = ! target . result . isWasm () and ! std .mem .eql (u8 , platform , "sokol" );
83
83
const sdl_sdk = sdl .init (b , "" );
84
84
85
85
_ = getZimpactModule (b , .{
@@ -113,7 +113,6 @@ pub fn build(b: *std.Build) !void {
113
113
// build Z Drop sample
114
114
const sample : []const u8 = "zdrop" ;
115
115
if (! target .result .isWasm ()) {
116
- const run_step = b .step (b .fmt ("run" , .{}), b .fmt ("Run {s}.zig example" , .{sample }));
117
116
// for native platforms, build into a regular executable
118
117
const exe = b .addExecutable (.{
119
118
.name = sample ,
@@ -125,16 +124,18 @@ pub fn build(b: *std.Build) !void {
125
124
sdl_sdk .link (exe , .dynamic );
126
125
}
127
126
exe .root_module .addImport ("zimpact" , mod_zi );
127
+ const install_exe = b .addInstallArtifact (exe , .{});
128
+ install_exe .step .dependOn (assets_step );
129
+ b .getInstallStep ().dependOn (& install_exe .step );
128
130
129
131
const run_cmd = b .addRunArtifact (exe );
130
- run_cmd .step .dependOn (& b .addInstallArtifact (exe , .{}).step );
132
+ const run_step = b .step (b .fmt ("run" , .{}), b .fmt ("Run {s}.zig example" , .{sample }));
133
+ run_cmd .step .dependOn (& install_exe .step );
134
+ run_step .dependOn (& run_cmd .step );
131
135
132
136
if (b .args ) | args | {
133
137
run_cmd .addArgs (args );
134
138
}
135
-
136
- run_step .dependOn (assets_step );
137
- run_step .dependOn (& run_cmd .step );
138
139
} else {
139
140
try buildWeb (b , .{
140
141
.root_source_file = b .path ("samples/zdrop/main.zig" ),
0 commit comments