https://github.com/allyourcodebase/json-c
json-c ported to the zig build system
https://github.com/allyourcodebase/json-c
zig-package
Last synced: 5 days ago
JSON representation
json-c ported to the zig build system
- Host: GitHub
- URL: https://github.com/allyourcodebase/json-c
- Owner: allyourcodebase
- License: mit
- Created: 2024-09-14T07:01:13.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-09-18T11:51:14.000Z (over 1 year ago)
- Last Synced: 2025-01-11T15:23:18.466Z (about 1 year ago)
- Topics: zig-package
- Language: Zig
- Homepage:
- Size: 13.7 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# `build.zig` for json-c
Provides a package to be used by the zig package manager for C programs.
## Status
For now the hard-coded config assumes linux.
| Refname | json-c version | Zig `0.15.0-dev` | Zig `0.14.x` | Zig `0.13.x` | Zig `0.12.x` |
|----------|------------------------|------------------|--------------|--------------|--------------|
| `0.18+2` | `json-c-0.18-20240915` | ✅ | ✅ | ❌ | ❌ |
| `0.18+1` | `json-c-0.18-20240915` | ❌ | ✅ | ❌ | ❌ |
| `0.18` | `json-c-0.18-20240915` | ❌ | ❌ | ✅ | ✅ |
| `0.17` | `json-c-0.17-20230812` | ❌ | ❌ | ✅ | ✅ |
## Use
Add the dependency in your `build.zig.zon` by running the following command:
```bash
zig fetch --save git+https://github.com/allyourcodebase/json-c#master
```
Then, in your `build.zig`:
```zig
const jsonc = b.dependency("jsonc", { .target = target, .optimize = optimize });
const libjsonc = jsonc.artifact("json-c");
// wherever needed:
exe.linkLibrary(libjsonc);
```