zig/test
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
..
behavior std.Build: add addLibrary function (#22554) 2025-01-22 02:29:21 +00:00
c_abi std.Target: Replace isARM() with isArmOrThumb() and rename it to isArm(). 2024-11-03 09:29:30 +01:00
c_import std: update std.builtin.Type fields to follow naming conventions 2024-08-28 08:39:59 +01:00
cases compiler: simplify generic functions, fix issues with inline calls 2025-01-21 02:41:42 +00:00
incremental incremental: fix enum resolution bugs 2025-01-18 14:30:06 +00:00
link std.Build: add addLibrary function (#22554) 2025-01-22 02:29:21 +00:00
src std.Build: add addLibrary function (#22554) 2025-01-22 02:29:21 +00:00
standalone std.Build: add addLibrary function (#22554) 2025-01-22 02:29:21 +00:00
assemble_and_link.zig migrate from std.Target.current to @import("builtin").target 2021-10-04 23:48:55 -07:00
behavior.zig x86_64: testing 2025-01-16 20:42:08 -05:00
c_import.zig c_import: extract behavior tests that use @cImport 2024-02-20 18:44:43 +01:00
cases.zig remove test/cbe.zig 2024-03-28 15:24:01 +02:00
compare_output.zig compiler: remove anonymous struct types, unify all tuples 2024-10-31 20:42:53 +00:00
compile_errors.zig Sema: rewrite semantic analysis of function calls 2025-01-09 06:46:47 +00:00
gen_h.zig all: zig fmt and rename "@XToY" to "@YFromX" 2023-06-19 12:34:42 -07:00
llvm_targets.zig std.Target: Remove Os.Tag.bridgeos. 2024-12-03 20:43:15 +01:00
nvptx.zig test: Set emit_bin=false for all nvptx tests. 2024-11-24 22:11:17 +01:00
run_translated_c.zig remove hard tabs from source code 2024-07-31 16:57:42 -07:00
stack_traces.zig test/stack_traces.zig: add err union switch case 2024-01-18 15:10:32 +11:00
tests.zig build: respect -Duse-llvm option when doing behavior tests 2025-01-15 15:11:36 -08:00
translate_c.zig test: update for CallingConvention changes 2024-10-19 19:15:23 +01:00