mirror of
https://github.com/ziglang/zig.git
synced 2024-11-29 00:22:33 +00:00
2b0d322ea0
This commits permits passing in static archives using the system lib flag `-la`. With this commit, `zig ld` will now look firstly for a dynamic library (which always takes precedence), and will fall back on `liba.a` if the dylib is not found. The static archive is searched for in the system lib search dirs like the dylibs.
9 lines
187 B
Zig
9 lines
187 B
Zig
const std = @import("std");
|
|
const expect = std.testing.expect;
|
|
const c = @cImport(@cInclude("a.h"));
|
|
|
|
test "import C add" {
|
|
const result = c.add(2, 1);
|
|
try expect(result == 3);
|
|
}
|