File tree Expand file tree Collapse file tree 3 files changed +16
-18
lines changed Expand file tree Collapse file tree 3 files changed +16
-18
lines changed Original file line number Diff line number Diff line change 20
20
runs-on : ${{ matrix.os }}
21
21
22
22
steps :
23
- - name : Check out repository
24
- uses : actions/checkout@v4
25
-
26
- - name : Set up Zig
27
- uses : mlugg/setup-zig@v1
23
+ - uses : actions/checkout@v4
24
+ - uses : mlugg/setup-zig@v2
28
25
with :
29
26
version : ${{ matrix.zig-version }}
30
-
31
- - name : Run `build`
32
- run : zig build --summary all
27
+ - run : zig build --summary all
Original file line number Diff line number Diff line change @@ -6,17 +6,18 @@ Provides a package to be used by the zig package manager for C programs.
6
6
7
7
For now the hard-coded config assumes linux.
8
8
9
- | Refname | json-c version | Zig ` 0.12.x ` | Zig ` 0.13.x ` | Zig ` 0.14.x ` |
10
- | ----------| ------------------------| --------------| --------------| --------------|
11
- | ` 0.17 ` | ` json-c-0.17-20230812 ` | ✅ | ✅ | ❌ |
12
- | ` 0.18 ` | ` json-c-0.18-20240915 ` | ✅ | ✅ | ❌ |
13
- | ` 0.18+1 ` | ` json-c-0.18-20240915 ` | ❌ | ❌ | ✅ |
9
+ | Refname | json-c version | Zig ` 0.15.0-dev ` | Zig ` 0.14.x ` | Zig ` 0.13.x ` | Zig ` 0.12.x ` |
10
+ | ----------| ------------------------| ------------------| --------------| --------------| --------------|
11
+ | ` 0.18+2 ` | ` json-c-0.18-20240915 ` | ✅ | ✅ | ❌ | ❌ |
12
+ | ` 0.18+1 ` | ` json-c-0.18-20240915 ` | ❌ | ✅ | ❌ | ❌ |
13
+ | ` 0.18 ` | ` json-c-0.18-20240915 ` | ❌ | ❌ | ✅ | ✅ |
14
+ | ` 0.17 ` | ` json-c-0.17-20230812 ` | ❌ | ❌ | ✅ | ✅ |
14
15
15
16
## Use
16
17
17
18
Add the dependency in your ` build.zig.zon ` by running the following command:
18
19
``` bash
19
- zig fetch --save git+https://github.com/allyourcodebase/json-c#0.18+1
20
+ zig fetch --save git+https://github.com/allyourcodebase/json-c#master
20
21
```
21
22
22
23
Then, in your ` build.zig ` :
Original file line number Diff line number Diff line change @@ -48,11 +48,13 @@ pub fn build(b: *std.Build) !void {
48
48
.SIZEOF_SSIZE_T = @sizeOf (isize ),
49
49
});
50
50
51
- const lib = b .addStaticLibrary (.{
51
+ const lib = b .addLibrary (.{
52
52
.name = "json-c" ,
53
- .target = target ,
54
- .optimize = optimize ,
55
- .link_libc = true ,
53
+ .root_module = b .createModule (.{
54
+ .target = target ,
55
+ .optimize = optimize ,
56
+ .link_libc = true ,
57
+ }),
56
58
});
57
59
lib .addIncludePath (upstream .path ("" ));
58
60
lib .addConfigHeader (config );
You can’t perform that action at this time.
0 commit comments