summaryrefslogtreecommitdiffstatshomepage
path: root/build.zig
diff options
context:
space:
mode:
authorManlio Perillo <manlio.perillo@gmail.com>2023-05-13 21:18:40 +0200
committerManlio Perillo <manlio.perillo@gmail.com>2023-05-14 17:22:03 +0200
commit9b7ef7d8cfc3faec3d0a111dd80f2c37db6b7c79 (patch)
treef50b0d117c73e2a5d00dc52d3edd0d6a4d16727b /build.zig
parent0304dc3d37ba1e8443a8a1c835ad9c0988e4a3df (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.zig43
1 files changed, 0 insertions, 43 deletions
diff --git a/build.zig b/build.zig
index 2170f1c..9578345 100644
--- a/build.zig
+++ b/build.zig
@@ -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)`.
///