Skip to content

Commit

Permalink
win32: Use Console subsystem on debug builds
Browse files Browse the repository at this point in the history
Using the console subsystem allows to use std.log and other console-related operations, which is very useful for logging. This comes at the cost of the executable opening a new console window (cmdhost.exe) but this is not deranging given it's only for Debug mode builds.
  • Loading branch information
zenith391 committed Jul 30, 2022
1 parent 352a959 commit aed5e0f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion build_capy.zig
Expand Up @@ -21,7 +21,10 @@ pub fn install(step: *std.build.LibExeObjStep, comptime prefix: []const u8) !voi
else => {},
};

step.subsystem = .Windows;
switch (step.build_mode) {
.Debug => step.subsystem = .Console,
else => step.subsystem = .Windows,
}
step.linkSystemLibrary("comctl32");
step.linkSystemLibrary("gdi32");
step.linkSystemLibrary("gdiplus");
Expand Down

0 comments on commit aed5e0f

Please sign in to comment.