Skip to content

Commit

Permalink
build: apply the Console subsystem for Debug builds
Browse files Browse the repository at this point in the history
If no subsystem is specified, then the resulted binary doesn't
constitute as a valid binary Win32 executable. Hence the need to specify
a subsystem for debug builds too. The `.Console` subsystem was chosen as
it allows for standard output to be logged in a console (which is quite
useful for debug builds)
  • Loading branch information
zenith391 committed Aug 1, 2024
1 parent 36a3047 commit 2de5266
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions build_capy.zig
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,10 @@ pub fn runStep(step: *std.Build.Step.Compile, options: CapyRunOptions) !*std.Bui
const optimize = step.root_module.optimize.?;
switch (step.rootModuleTarget().os.tag) {
.windows => {
switch (optimize) {
.Debug => {},
else => step.subsystem = .Windows,
}
step.subsystem = switch (optimize) {
.Debug => .Console,
else => .Windows,
};
},
.macos => {},
.linux, .freebsd => {
Expand Down

0 comments on commit 2de5266

Please sign in to comment.