| ... | @@ -215,13 +215,17 @@ pub const Builder = struct { | ... | @@ -215,13 +215,17 @@ pub const Builder = struct { |
| 215 | return addExecutableSource(self, name, convertOptionalPathToFileSource(root_src), .static); | 215 | return addExecutableSource(self, name, convertOptionalPathToFileSource(root_src), .static); |
| 216 | } | 216 | } |
| 217 | | 217 | |
| 218 | pub const addExecutableSource = LibExeObjStep.createExecutable; | 218 | pub fn addExecutableSource(builder: *Builder, name: []const u8, root_src: ?FileSource, linkage: LibExeObjStep.Linkage) *LibExeObjStep { |
| | 219 | return LibExeObjStep.createExecutable(builder, name, root_src, linkage); |
| | 220 | } |
| 219 | | 221 | |
| 220 | pub fn addObject(self: *Builder, name: []const u8, root_src: ?[]const u8) *LibExeObjStep { | 222 | pub fn addObject(self: *Builder, name: []const u8, root_src: ?[]const u8) *LibExeObjStep { |
| 221 | return addObjectSource(self, name, convertOptionalPathToFileSource(root_src)); | 223 | return addObjectSource(self, name, convertOptionalPathToFileSource(root_src)); |
| 222 | } | 224 | } |
| 223 | | 225 | |
| 224 | pub const addObjectSource = LibExeObjStep.createObject; | 226 | pub fn addObjectSource(builder: *Builder, name: []const u8, root_src: ?FileSource) *LibExeObjStep { |
| | 227 | return LibExeObjStep.createObject(builder, name, root_src); |
| | 228 | } |
| 225 | | 229 | |
| 226 | pub fn addSharedLibrary( | 230 | pub fn addSharedLibrary( |
| 227 | self: *Builder, | 231 | self: *Builder, |
| ... | @@ -232,14 +236,22 @@ pub const Builder = struct { | ... | @@ -232,14 +236,22 @@ pub const Builder = struct { |
| 232 | return addSharedLibrarySource(self, name, convertOptionalPathToFileSource(root_src), kind); | 236 | return addSharedLibrarySource(self, name, convertOptionalPathToFileSource(root_src), kind); |
| 233 | } | 237 | } |
| 234 | | 238 | |
| 235 | pub const addSharedLibrarySource = LibExeObjStep.createSharedLibrary; | 239 | pub fn addSharedLibrarySource( |
| | 240 | self: *Builder, |
| | 241 | name: []const u8, |
| | 242 | root_src: ?FileSource, |
| | 243 | kind: LibExeObjStep.SharedLibKind, |
| | 244 | ) *LibExeObjStep { |
| | 245 | return LibExeObjStep.createSharedLibrary(self, name, root_src, kind); |
| | 246 | } |
| 236 | | 247 | |
| 237 | pub fn addStaticLibrary(self: *Builder, name: []const u8, root_src: ?[]const u8) *LibExeObjStep { | 248 | pub fn addStaticLibrary(self: *Builder, name: []const u8, root_src: ?[]const u8) *LibExeObjStep { |
| 238 | const root_src_param = if (root_src) |p| @as(FileSource, .{ .path = p }) else null; | 249 | return addStaticLibrarySource(self, name, convertOptionalPathToFileSource(root_src)); |
| 239 | return LibExeObjStep.createStaticLibrary(self, name, root_src_param); | | |
| 240 | } | 250 | } |
| 241 | | 251 | |
| 242 | pub const addStaticLibrarySource = LibExeObjStep.createStaticLibrary; | 252 | pub fn addStaticLibrarySource(self: *Builder, name: []const u8, root_src: ?FileSource) *LibExeObjStep { |
| | 253 | return LibExeObjStep.createStaticLibrary(self, name, root_src); |
| | 254 | } |
| 243 | | 255 | |
| 244 | pub fn addTest(self: *Builder, root_src: []const u8) *LibExeObjStep { | 256 | pub fn addTest(self: *Builder, root_src: []const u8) *LibExeObjStep { |
| 245 | return LibExeObjStep.createTest(self, "test", .{ .path = root_src }); | 257 | return LibExeObjStep.createTest(self, "test", .{ .path = root_src }); |
| ... | @@ -1232,8 +1244,11 @@ pub const GeneratedFile = struct { | ... | @@ -1232,8 +1244,11 @@ pub const GeneratedFile = struct { |
| 1232 | /// This value must be set in the `fn make()` of the `step` and must not be `null` afterwards. | 1244 | /// This value must be set in the `fn make()` of the `step` and must not be `null` afterwards. |
| 1233 | path: ?[]const u8 = null, | 1245 | path: ?[]const u8 = null, |
| 1234 | | 1246 | |
| 1235 | pub fn getPath(self: *const GeneratedFile) []const u8 { | 1247 | pub fn getPath(self: GeneratedFile) []const u8 { |
| 1236 | return self.path orelse @panic("getPath() was called on a GeneratedFile that wasn't build yet. Is there a missing Step dependency?"); | 1248 | return self.path orelse std.debug.panic( |
| | 1249 | "getPath() was called on a GeneratedFile that wasn't build yet. Is there a missing Step dependency on step '{s}'?", |
| | 1250 | .{self.step.name}, |
| | 1251 | ); |
| 1237 | } | 1252 | } |
| 1238 | }; | 1253 | }; |
| 1239 | | 1254 | |