feature. See also
. The project being documented here (as the example) is the Zig library itself.
Maker.installSymLinks
pub fn installSymLinks(
maker: *Maker,
arena: Allocator,
output_path: Path,
compile_step_index: Configuration.Step.Index,
asking_step_index: Configuration.Step.Index,
) !void
File
Code
pub fn installSymLinks(
maker: *Maker,
arena: Allocator,
output_path: Path,
compile_step_index: Configuration.Step.Index,
asking_step_index: Configuration.Step.Index,
) !void {
const c = &maker.scanned_config.configuration;
const conf_step = compile_step_index.ptr(c);
const conf_comp = conf_step.extended.get(c.extra).compile;
const root_module = conf_comp.root_module.get(c);
const target = root_module.resolved_target.get(c).?.result.get(c);
const os_tag = target.flags.os_tag.unwrap().?;
assert(conf_comp.flags3.kind == .lib);
assert(conf_comp.flags2.linkage == .dynamic);
assert(os_tag != .windows);
const version = std.SemanticVersion.parse(conf_comp.version.value.?.slice(c)) catch unreachable;
const name = conf_comp.root_name.slice(c);
const filename_major_only, const filename_name_only = if (os_tag.isDarwin()) .{
try arena.print("lib{s}.{d}.dylib", .{ name, version.major }),
try arena.print("lib{s}.dylib", .{name}),
} else .{
try arena.print("lib{s}.so.{d}", .{ name, version.major }),
try arena.print("lib{s}.so", .{name}),
};
return installSymLinksInner(maker, arena, output_path, asking_step_index, filename_major_only, filename_name_only);
}