authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-10-19 15:11:23-04:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2019-10-19 15:11:23-04:00
logdbb1eaefb50572d3c11129925f3e0fdedf758723
tree3e60ffbd5cb90d8322fb1ca64d7d0f4400b0edc9
parent6f7939a452e69b77581f5390b8075e9dfa81b03e
parentc8dec5729cabb90fa56fad2b6d77171189e01703
signaturebadge-question-mark Signed by PGP key 4AEE18F83AFDEB23

Merge pull request #3473 from nrdmn/subsystem

Configurable PE Subsystem

2 files changed, 16 insertions(+), 1 deletions(-)

lib/std/build.zig+16
......@@ -1491,6 +1491,8 @@ pub const LibExeObjStep = struct {
14911491 /// Position Independent Code
14921492 force_pic: ?bool = null,
14931493
1494 subsystem: ?builtin.SubSystem = null,
1495
14941496 const LinkObject = union(enum) {
14951497 StaticPath: []const u8,
14961498 OtherStep: *LibExeObjStep,
......@@ -2325,6 +2327,20 @@ pub const LibExeObjStep = struct {
23252327 }
23262328 }
23272329
2330 if (self.subsystem) |subsystem| {
2331 try zig_args.append("--subsystem");
2332 try zig_args.append(switch (subsystem) {
2333 .Console => "console",
2334 .Windows => "windows",
2335 .Posix => "posix",
2336 .Native => "native",
2337 .EfiApplication => "efi_application",
2338 .EfiBootServiceDriver => "efi_boot_service_driver",
2339 .EfiRom => "efi_rom",
2340 .EfiRuntimeDriver => "efi_runtime_driver",
2341 });
2342 }
2343
23282344 if (self.kind == Kind.Test) {
23292345 try builder.spawnChild(zig_args.toSliceConst());
23302346 } else {
lib/std/os/windows.zig-1
......@@ -42,7 +42,6 @@ pub const subsystem: ?builtin.SubSystem = blk: {
4242 break :blk builtin.SubSystem.Console;
4343 }
4444 },
45 .uefi => break :blk builtin.SubSystem.EfiApplication,
4645 else => break :blk null,
4746 }
4847};