Skip to content

Commit a9067fb

Browse files
authored
Merge pull request #1 from Techatrix/main
enhance integration with improved build options, CI, tests and cstool
2 parents 8c48920 + 6a33d60 commit a9067fb

File tree

6 files changed

+537
-156
lines changed

6 files changed

+537
-156
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*.zig text eol=lf
2+
*.zon text eol=lf

.github/workflows/ci.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
workflow_dispatch:
11+
12+
jobs:
13+
build:
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
zig-version:
18+
- 0.13.0
19+
- master # Let's test master while it works so that breaking it is deliberate decision
20+
os:
21+
- ubuntu-latest
22+
- macos-latest
23+
- windows-latest
24+
runs-on: ${{ matrix.os }}
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v4
28+
29+
- name: Setup Zig
30+
uses: mlugg/setup-zig@v1
31+
with:
32+
version: ${{ matrix.zig-version }}
33+
34+
- name: Check Formatting
35+
run: zig fmt --ast-check --check .
36+
37+
- name: Build
38+
run: zig build --summary all

.gitignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
zig-out/**
2-
zig-cache/**
3-
.zig-cache/**
1+
zig-out
2+
zig-cache
3+
.zig-cache

README.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,25 @@
1+
[![CI](https://github.com/allyourcodebase/capstone/actions/workflows/ci.yaml/badge.svg)](https://github.com/allyourcodebase/capstone/actions)
2+
13
# capstone
2-
This just enables to use [capstone](https://github.com/capstone-engine/capstone) as a Dependency for the Zig build system.
4+
5+
This is [capstone](https://github.com/capstone-engine/capstone), packaged for [Zig](https://ziglang.org/).
6+
7+
## Installation
8+
9+
First, update your `build.zig.zon`:
10+
11+
```
12+
# Initialize a `zig build` project if you haven't already
13+
zig init
14+
zig fetch --save git+https://github.com/allyourcodebase/capstone.git#5.0.1
15+
```
16+
17+
You can then import `capstone` in your `build.zig` with:
18+
19+
```zig
20+
const capstone_dependency = b.dependency("capstone", .{
21+
.target = target,
22+
.optimize = optimize,
23+
});
24+
your_exe.linkLibrary(capstone_dependency.artifact("capstone"));
25+
```

0 commit comments

Comments
 (0)