| ... | @@ -150,7 +150,11 @@ pub const Builder = struct { | ... | @@ -150,7 +150,11 @@ pub const Builder = struct { |
| 150 | } | 150 | } |
| 151 | | 151 | |
| 152 | pub fn addExecutable(self: *Builder, name: []const u8, root_src: ?[]const u8) *LibExeObjStep { | 152 | pub fn addExecutable(self: *Builder, name: []const u8, root_src: ?[]const u8) *LibExeObjStep { |
| 153 | return LibExeObjStep.createExecutable(self, name, root_src); | 153 | return LibExeObjStep.createExecutable(self, name, root_src, false); |
| | 154 | } |
| | 155 | |
| | 156 | pub fn addStaticExecutable(self: *Builder, name: []const u8, root_src: ?[]const u8) *LibExeObjStep { |
| | 157 | return LibExeObjStep.createExecutable(self, name, root_src, true); |
| 154 | } | 158 | } |
| 155 | | 159 | |
| 156 | pub fn addObject(self: *Builder, name: []const u8, root_src: []const u8) *LibExeObjStep { | 160 | pub fn addObject(self: *Builder, name: []const u8, root_src: []const u8) *LibExeObjStep { |
| ... | @@ -891,8 +895,8 @@ pub const LibExeObjStep = struct { | ... | @@ -891,8 +895,8 @@ pub const LibExeObjStep = struct { |
| 891 | return self; | 895 | return self; |
| 892 | } | 896 | } |
| 893 | | 897 | |
| 894 | pub fn createExecutable(builder: *Builder, name: []const u8, root_src: ?[]const u8) *LibExeObjStep { | 898 | pub fn createExecutable(builder: *Builder, name: []const u8, root_src: ?[]const u8, static: bool) *LibExeObjStep { |
| 895 | const self = builder.allocator.create(initExtraArgs(builder, name, root_src, Kind.Exe, false, builder.version(0, 0, 0))) catch unreachable; | 899 | const self = builder.allocator.create(initExtraArgs(builder, name, root_src, Kind.Exe, static, builder.version(0, 0, 0))) catch unreachable; |
| 896 | return self; | 900 | return self; |
| 897 | } | 901 | } |
| 898 | | 902 | |
| ... | @@ -1270,6 +1274,9 @@ pub const LibExeObjStep = struct { | ... | @@ -1270,6 +1274,9 @@ pub const LibExeObjStep = struct { |
| 1270 | zig_args.append("--ver-patch") catch unreachable; | 1274 | zig_args.append("--ver-patch") catch unreachable; |
| 1271 | zig_args.append(builder.fmt("{}", self.version.patch)) catch unreachable; | 1275 | zig_args.append(builder.fmt("{}", self.version.patch)) catch unreachable; |
| 1272 | } | 1276 | } |
| | 1277 | if (self.kind == Kind.Exe and self.static) { |
| | 1278 | zig_args.append("--static") catch unreachable; |
| | 1279 | } |
| 1273 | | 1280 | |
| 1274 | switch (self.target) { | 1281 | switch (self.target) { |
| 1275 | Target.Native => {}, | 1282 | Target.Native => {}, |