Hi,
For my project I need access to a few functions, for example mach_vm_region.
I currently have this c.zig file.
pub usingnamespace @cImport({
@cInclude("libproc.h");
@cInclude("mach/mach.h");
@cInclude("mach/mach_vm.h");
@cInclude("mach/vm_region.h");
});
In another file I used it like this const c = @import("c.zig");.
This is my build.zig file.
const std = @import("std");
const targets: []const std.Target.Query = &.{
.{ .cpu_arch = .aarch64, .os_tag = .macos },
.{ .cpu_arch = .x86_64, .os_tag = .macos },
};
pub fn build(b: *std.Build) void {
for (targets) |t| {
const exe = b.addExecutable(.{
.name = "G-MemZ",
.root_source_file = b.path("src/main.zig"),
.target = b.resolveTargetQuery(t),
.optimize = .ReleaseSmall,
});
const target_output = b.addInstallArtifact(exe, .{
.dest_dir = .{
.override = .{
.custom = t.zigTriple(b.allocator) catch "unknown",
},
},
});
b.getInstallStep().dependOn(&target_output.step);
}
}
However it is unable to find the include mach/mach-vm.h.
What would be the simplest way to solve this?