How do I run code after build.zig finished building the app?
I'm trying to do it with a custom build step but it segfaults:
const std = @import("std");
pub fn build(b: *std.build.Builder) void {
const target = b.standardTargetOptions(.{});
const mode = b.standardReleaseOptions();
const exe = b.addExecutable("x", "src/main.zig");
exe.setTarget(target);
exe.setBuildMode(mode);
exe.install();
var x_step = std.build.Step.init(.run, "x", b.allocator, x);
exe.install_step.?.step.dependOn(&x_step);
}
fn x(step: *std.build.Step) !void {
_ = step;
}
$ zig build
Segmentation fault at address 0x8
I've been getting segfaults with all kind of things I tried so I'm a bit confused.