Up til now I’ve been working only in Zig 0.11. Today I decided to install master (using zvm) so that I can get a sense of what changes the upcoming release of Zig will entail. Immediately I hit the following error:
/tmp/e1bde732f5b919a56f97e346aa6d5683/linux/x64/build.zig:15:8: error: no field or member function named 'addModule' in 'Build.Step.Compile'
A scan of the documentation didn’t readily reveal what the replacement function is. I’m sure one of you must know what the new way of doing thing is. Here’s the build file:
const std = @import("std");
const cfg = @import("./build-cfg.zig");
pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{
.default_target = cfg.target,
});
const optimize = b.standardOptimizeOption(.{});
const lib = b.addSharedLibrary(.{
.name = cfg.package_name,
.root_source_file = .{ .path = cfg.stub_path },
.target = target,
.optimize = optimize,
});
lib.addModule("exporter", b.createModule(.{
.source_file = .{ .path = cfg.exporter_path },
}));
lib.addModule("package", b.createModule(.{
.source_file = .{ .path = cfg.package_path },
}));
if (cfg.use_libc) {
lib.linkLibC();
}
if (cfg.target.cpu_arch == .wasm32) {
lib.use_lld = false;
lib.rdynamic = true;
}
b.installArtifact(lib);
}
Thanks in advance.