diff options
author | Manlio Perillo <manlio.perillo@gmail.com> | 2023-05-13 21:18:40 +0200 |
---|---|---|
committer | Manlio Perillo <manlio.perillo@gmail.com> | 2023-05-14 17:22:03 +0200 |
commit | 9b7ef7d8cfc3faec3d0a111dd80f2c37db6b7c79 (patch) | |
tree | f50b0d117c73e2a5d00dc52d3edd0d6a4d16727b /build.zig | |
parent | 0304dc3d37ba1e8443a8a1c835ad9c0988e4a3df (diff) |
build: remove unused declarations
Remove the `Exercise.addExecutable` method and the `SkipStep` struct, since
they are no longer used.
Diffstat (limited to 'build.zig')
-rw-r--r-- | build.zig | 43 |
1 files changed, 0 insertions, 43 deletions
@@ -64,20 +64,6 @@ pub const Exercise = struct { pub fn number(self: Exercise) usize { return std.fmt.parseInt(usize, self.key(), 10) catch unreachable; } - - /// Returns the CompileStep for this exercise. - /// - /// TODO: currently this method is no longer used. - pub fn addExecutable(self: Exercise, b: *Build, work_path: []const u8) *CompileStep { - const path = join(b.allocator, &.{ work_path, self.main_file }) catch - @panic("OOM"); - - return b.addExecutable(.{ - .name = self.name(), - .root_source_file = .{ .path = path }, - .link_libc = self.link_libc, - }); - } }; pub const logo = @@ -643,35 +629,6 @@ const PrintStep = struct { } }; -/// Skips an exercise. -const SkipStep = struct { - step: Step, - exercise: Exercise, - - pub fn create(owner: *Build, exercise: Exercise) *SkipStep { - const self = owner.allocator.create(SkipStep) catch @panic("OOM"); - self.* = .{ - .step = Step.init(.{ - .id = .custom, - .name = owner.fmt("skip {s}", .{exercise.main_file}), - .owner = owner, - .makeFn = make, - }), - .exercise = exercise, - }; - - return self; - } - - fn make(step: *Step, _: *std.Progress.Node) !void { - const self = @fieldParentPtr(SkipStep, "step", step); - - if (self.exercise.skip) { - print("{s} skipped\n", .{self.exercise.main_file}); - } - } -}; - /// Checks that each exercise number, excluding the last, forms the sequence /// `[1, exercise.len)`. /// |