Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 5 additions & 17 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,11 @@ pub fn build(b: *std.Build) void {
};

const options_step = b.addOptions();
inline for (std.meta.fields(@TypeOf(options))) |field| {
options_step.addOption(field.type, field.name, @field(options, field.name));
inline for (
comptime std.meta.fieldTypes(@TypeOf(options)),
comptime std.meta.fieldNames(@TypeOf(options)),
) |field_type, field_name| {
options_step.addOption(field_type, field_name, @field(options, field_name));
}

const options_module = options_step.createModule();
Expand Down Expand Up @@ -109,19 +112,4 @@ pub fn build(b: *std.Build) void {
}

b.installArtifact(tracy);

const test_step = b.step("test", "Run ztracy tests");

const tests = b.addTest(.{
.name = "ztracy-tests",
.root_module = b.createModule(.{
.root_source_file = b.path("src/ztracy.zig"),
.target = target,
.optimize = optimize,
}),
});
tests.root_module.linkLibrary(tracy);
b.installArtifact(tests);

test_step.dependOn(&b.addRunArtifact(tests).step);
}
4 changes: 0 additions & 4 deletions src/ztracy.zig
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,3 @@ pub const PlotI = if (enabled) impl.PlotI else stub.PlotI;
pub const AppInfo = if (enabled) impl.AppInfo else stub.AppInfo;

pub const TracyAllocator = if (enabled) impl.TracyAllocator else stub.TracyAllocator;

test {
std.testing.refAllDeclsRecursive(@This());
}
Loading