mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-09-01 20:03:40 +00:00
remove src/bench
This commit is contained in:
@@ -528,7 +528,6 @@ pub const ExeEntrypoint = enum {
|
||||
webgen_config,
|
||||
webgen_actions,
|
||||
webgen_commands,
|
||||
bench_stream,
|
||||
};
|
||||
|
||||
/// The release channel for the build.
|
||||
|
||||
@@ -47,54 +47,6 @@ pub fn init(
|
||||
try steps.append(exe);
|
||||
}
|
||||
|
||||
// Open the directory ./src/bench
|
||||
const c_dir_path = b.pathFromRoot("src/bench");
|
||||
var c_dir = try std.fs.cwd().openDir(c_dir_path, .{ .iterate = true });
|
||||
defer c_dir.close();
|
||||
|
||||
// Go through and add each as a step
|
||||
var c_dir_it = c_dir.iterate();
|
||||
while (try c_dir_it.next()) |entry| {
|
||||
// Get the index of the last '.' so we can strip the extension.
|
||||
const index = std.mem.lastIndexOfScalar(u8, entry.name, '.') orelse continue;
|
||||
if (index == 0) continue;
|
||||
|
||||
// If it doesn't end in 'zig' then ignore
|
||||
if (!std.mem.eql(u8, entry.name[index + 1 ..], "zig")) continue;
|
||||
|
||||
// Name of the conformance app and full path to the entrypoint.
|
||||
const name = entry.name[0..index];
|
||||
|
||||
// Executable builder.
|
||||
const bin_name = try std.fmt.allocPrint(b.allocator, "bench-{s}", .{name});
|
||||
const c_exe = b.addExecutable(.{
|
||||
.name = bin_name,
|
||||
.root_module = b.createModule(.{
|
||||
.root_source_file = b.path("src/main.zig"),
|
||||
.target = deps.config.target,
|
||||
|
||||
// We always want our benchmarks to be in release mode.
|
||||
.optimize = .ReleaseFast,
|
||||
}),
|
||||
});
|
||||
c_exe.linkLibC();
|
||||
|
||||
// Update our entrypoint
|
||||
var enum_name: [64]u8 = undefined;
|
||||
@memcpy(enum_name[0..name.len], name);
|
||||
std.mem.replaceScalar(u8, enum_name[0..name.len], '-', '_');
|
||||
|
||||
var buf: [64]u8 = undefined;
|
||||
const new_deps = try deps.changeEntrypoint(b, std.meta.stringToEnum(
|
||||
Config.ExeEntrypoint,
|
||||
try std.fmt.bufPrint(&buf, "bench_{s}", .{enum_name[0..name.len]}),
|
||||
).?);
|
||||
|
||||
_ = try new_deps.add(c_exe);
|
||||
|
||||
try steps.append(c_exe);
|
||||
}
|
||||
|
||||
return .{ .steps = steps.items };
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user