feat(benchmark): add benchmark build (with build option) to test frame rate

This commit is contained in:
2024-11-09 01:17:09 +01:00
parent 2d2e63ac63
commit 817d818d4c
3 changed files with 53 additions and 6 deletions

View File

@@ -15,6 +15,14 @@ pub fn build(b: *std.Build) void {
// set a preferred release mode, allowing the user to decide how to optimize.
const optimize = b.standardOptimizeOption(.{});
// build options to customize the log message formatting
const benchmark = b.option(bool, "benchmark", "Create a benchmark build (default: false)") orelse false;
const options = b.addOptions();
options.addOption(bool, "benchmark", benchmark);
const options_module = options.createModule();
// Dependencies
const vaxis_dep = b.dependency("vaxis", .{
.optimize = optimize,
@@ -37,6 +45,7 @@ pub fn build(b: *std.Build) void {
.target = target,
.optimize = optimize,
});
exe.root_module.addImport("build_options", options_module);
exe.root_module.addImport("vaxis", vaxis_dep.module("vaxis"));
exe.root_module.addImport("zlog", zlog_dep.module("zlog"));
exe.root_module.addImport("zmd", zmd_dep.module("zmd"));