Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
fail-fast: false
matrix:
zig-version: [master]
zig-version: [0.16.0]
os: [ubuntu-latest]
target:
- x86_64-linux-gnu
Expand Down
19 changes: 12 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
# libffi zig
[![CI](https://github.com/allyourcodebase/libffi/actions/workflows/ci.yaml/badge.svg)](https://github.com/allyourcodebase/libffi/actions)

[libffi](https://github.com/libffi/libffi), packaged for the Zig build system.
# libffi

Supports x86_64, x86, aarch64, and arm on Linux, macOS, and BSDs.
This is [libffi](https://sourceware.org/libffi/), packaged for [Zig](https://ziglang.org/).

## Using
## Installation

First, update your `build.zig.zon`:

```
# Initialize a `zig build` project if you haven't already
zig init
zig fetch --save git+https://github.com/allyourcodebase/libffi.git
```

Then in your `build.zig`:
You can then import `libffi` in your `build.zig` with:

```zig
const libffi = b.dependency("libffi", .{ .target = target, .optimize = optimize });
exe.linkLibrary(libffi.artifact("ffi"));
const libffi = b.dependency("libffi", .{
.target = target,
.optimize = optimize,
});
exe.root_module.linkLibrary(libffi.artifact("ffi"));
```
Loading
Loading