https://github.com/allyourcodebase/catch2
Catch 2 ported to the zig build system
https://github.com/allyourcodebase/catch2
zig-package
Last synced: about 1 year ago
JSON representation
Catch 2 ported to the zig build system
- Host: GitHub
- URL: https://github.com/allyourcodebase/catch2
- Owner: allyourcodebase
- License: mit
- Created: 2024-09-18T20:09:35.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-01-08T10:33:58.000Z (about 1 year ago)
- Last Synced: 2025-01-08T11:32:54.401Z (about 1 year ago)
- Topics: zig-package
- Language: Zig
- Homepage:
- Size: 8.79 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# `build.zig` for Catch2
Provides a package to be used by the zig package manager for C++ programs.
## Status
| Refname | Catch2 version | Zig `0.12.x` | Zig `0.13.x` | Zig `0.14.0-dev` |
|:----------|:---------------|:------------:|:------------:|:----------------:|
| `3.8.0` | `v3.8.0` | ✅ | ✅ | ✅ |
| `3.7.1+1` | `v3.7.1` | ✅ | ✅ | ✅ |
## Use
Add the dependency in your `build.zig.zon` by running the following command:
```bash
zig fetch --save git+https://github.com/allyourcodebase/catch2#3.8.0
```
Then, in your `build.zig`:
```zig
const catch2_dep = b.dependency("catch2", { .target = target, .optimize = optimize });
const catch2_lib = catch2_dep.artifact("Catch2");
const catch2_main = catch2_dep.artifact("Catch2WithMain");
// wherever needed:
exe.linkLibrary(catch2_lib);
exe.linkLibrary(catch2_main);
```
A complete usage demonstration is provided in the [example](example) directory