diff options
| author | Nick Erdmann <n@nirf.de> | 2019-10-18 20:11:28 +0200 |
|---|---|---|
| committer | Nick Erdmann <n@nirf.de> | 2019-10-18 20:11:28 +0200 |
| commit | c8dec5729cabb90fa56fad2b6d77171189e01703 (patch) | |
| tree | 031b34b33b9cba158d37876e6c26347c4775d9ac /lib | |
| parent | 8774b1d9478139a8da0f43c49fc33e01c74a6a3f (diff) | |
| download | zig-c8dec5729cabb90fa56fad2b6d77171189e01703.tar.gz zig-c8dec5729cabb90fa56fad2b6d77171189e01703.zip | |
std/build: make subsystem configurable
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/std/build.zig | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/std/build.zig b/lib/std/build.zig index 68d3f2a315..cb02c8f131 100644 --- a/lib/std/build.zig +++ b/lib/std/build.zig @@ -1491,6 +1491,8 @@ pub const LibExeObjStep = struct { /// Position Independent Code force_pic: ?bool = null, + subsystem: ?builtin.SubSystem = null, + const LinkObject = union(enum) { StaticPath: []const u8, OtherStep: *LibExeObjStep, @@ -2325,6 +2327,20 @@ pub const LibExeObjStep = struct { } } + if (self.subsystem) |subsystem| { + try zig_args.append("--subsystem"); + try zig_args.append(switch (subsystem) { + .Console => "console", + .Windows => "windows", + .Posix => "posix", + .Native => "native", + .EfiApplication => "efi_application", + .EfiBootServiceDriver => "efi_boot_service_driver", + .EfiRom => "efi_rom", + .EfiRuntimeDriver => "efi_runtime_driver", + }); + } + if (self.kind == Kind.Test) { try builder.spawnChild(zig_args.toSliceConst()); } else { |
