zig/test/link
BratishkaErik 941677e083
std.Build: add addLibrary function (#22554)
Acts as a replacement for `addSharedLibrary` and `addStaticLibrary`, but
linking mode can be changed more easily in build.zig, for example:

In library:
```zig
const linkage = b.option(std.builtin.LinkMode, "linkage", "Link mode for a foo_bar library") orelse .static; // or other default

const lib = b.addLibrary(.{
    .linkage = linkage,
    .name = "foo_bar",
    .root_module = mod,
});
```

In consumer:
```zig
const dep_foo_bar = b.dependency("foo_bar", .{
    .target = target,
    .optimize = optimize,
    .linkage = .static // or dynamic
});

mod.linkLibrary(dep_foor_bar.artifact("foo_bar"));
```

It also matches nicely with `linkLibrary` name.

Signed-off-by: Eric Joldasov <bratishkaerik@landless-city.net>
2025-01-22 02:29:21 +00:00
..
bss test-link: migrate from deprecated std.Build APIs 2024-12-18 01:49:10 +05:00
common_symbols std.Build: add addLibrary function (#22554) 2025-01-22 02:29:21 +00:00
common_symbols_alignment std.Build: add addLibrary function (#22554) 2025-01-22 02:29:21 +00:00
glibc_compat test-link: migrate from deprecated std.Build APIs 2024-12-18 01:49:10 +05:00
interdependent_static_c_libs std.Build: add addLibrary function (#22554) 2025-01-22 02:29:21 +00:00
static_libs_from_object_files std.Build: add addLibrary function (#22554) 2025-01-22 02:29:21 +00:00
wasm test/link/wasm/shared-memory: update to better linker behavior 2025-01-15 19:44:20 -08:00
build.zig std: update std.builtin.Type fields to follow naming conventions 2024-08-28 08:39:59 +01:00
build.zig.zon test/link/wasm/segment: delete bad test 2025-01-15 15:11:37 -08:00
elf.zig reject crti.o/crtn.o, embrace the future 2025-01-20 20:59:52 -08:00
link.zig std.Build: add addLibrary function (#22554) 2025-01-22 02:29:21 +00:00
macho.zig compiler: disallow callconv etc from depending on function parameters 2024-12-18 23:06:35 +00:00