File tree Expand file tree Collapse file tree 4 files changed +19
-16
lines changed Expand file tree Collapse file tree 4 files changed +19
-16
lines changed Original file line number Diff line number Diff line change 14
14
strategy :
15
15
fail-fast : false
16
16
matrix :
17
- zig-version : ["0.12.1", "0.13 .0", "master"]
17
+ zig-version : ["0.14 .0", "master"]
18
18
os : [ubuntu-latest]
19
19
20
20
runs-on : ${{ matrix.os }}
Original file line number Diff line number Diff line change @@ -6,22 +6,22 @@ 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.0-dev ` |
10
- | ---------| ------------------------| --------------| --------------| ---- --------------|
11
- | ` 0.17 ` | ` json-c-0.17-20230812 ` | ✅ | ✅ | ✅ |
12
- | ` 0.18 ` | ` json-c-0.18-20240915 ` | ✅ | ✅ | ✅ |
13
-
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 ` | ❌ | ❌ | ✅ |
14
14
15
15
## Use
16
16
17
17
Add the dependency in your ` build.zig.zon ` by running the following command:
18
18
``` bash
19
- zig fetch --save git+https://github.com/allyourcodebase/json-c#0.18
19
+ zig fetch --save git+https://github.com/allyourcodebase/json-c#0.18+1
20
20
```
21
21
22
22
Then, in your ` build.zig ` :
23
23
``` zig
24
- const jsonc = b.dependency("json-c ", { .target = target, .optimize = optimize });
24
+ const jsonc = b.dependency("jsonc ", { .target = target, .optimize = optimize });
25
25
const libjsonc = jsonc.artifact("json-c");
26
26
// wherever needed:
27
27
exe.linkLibrary(libjsonc);
Original file line number Diff line number Diff line change @@ -39,6 +39,14 @@ pub fn build(b: *std.Build) !void {
39
39
,
40
40
},
41
41
);
42
+ config .addValues (.{
43
+ .SIZEOF_INT = target .result .cTypeByteSize (.int ),
44
+ .SIZEOF_INT64_T = @sizeOf (i64 ),
45
+ .SIZEOF_LONG = target .result .cTypeByteSize (.long ),
46
+ .SIZEOF_LONG_LONG = target .result .cTypeByteSize (.longlong ),
47
+ .SIZEOF_SIZE_T = @sizeOf (usize ),
48
+ .SIZEOF_SSIZE_T = @sizeOf (isize ),
49
+ });
42
50
43
51
const lib = b .addStaticLibrary (.{
44
52
.name = "json-c" ,
@@ -158,12 +166,6 @@ const cmake_config = .{
158
166
.HAVE_STRTOULL = 1 ,
159
167
.HAVE___THREAD = 1 ,
160
168
.JSON_C_HAVE_INTTYPES_H = 1 ,
161
- .SIZEOF_INT = @sizeOf (c_int ),
162
- .SIZEOF_INT64_T = @sizeOf (i64 ),
163
- .SIZEOF_LONG = @sizeOf (c_long ),
164
- .SIZEOF_LONG_LONG = @sizeOf (c_longlong ),
165
- .SIZEOF_SIZE_T = @sizeOf (usize ),
166
- .SIZEOF_SSIZE_T = @sizeOf (isize ),
167
169
.SPEC___THREAD = "__thread" ,
168
170
.STDC_HEADERS = 1 ,
169
171
Original file line number Diff line number Diff line change 1
1
.{
2
- .name = "json-c" ,
2
+ .name = .jsonc ,
3
3
.version = "0.18.0" ,
4
- .minimum_zig_version = "0.12.0" ,
4
+ .minimum_zig_version = "0.14.0" ,
5
+ .fingerprint = 0x646d55b66fb40d ,
5
6
.dependencies = .{
6
7
.upstream = .{
7
8
.url = "git+https://github.com/json-c/json-c?ref=json-c-0.18-20240915#41a55cfcedb54d9c1874f2f0eb07b504091d7e37" ,
You can’t perform that action at this time.
0 commit comments