Skip to content

Commit

Permalink
Add zig package manager instructions to README
Browse files Browse the repository at this point in the history
  • Loading branch information
StrandedSoftwareDeveloper authored Oct 19, 2023
1 parent 58a749d commit 4c365dc
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,34 @@
# zigGenAlg
A simple generic genetic algorithm library for zig

Uses zig 0.11.0

To run example:
```
git clone https://github.com/StrandedSoftwareDeveloper/zigGenAlg.git
cd zigGenAlg
zig build example
```
Uses zig 0.11.0

To use with the zig package manager:
- Add this to your build.zig.zon:
```
.{
.name = "yourProjectName",
.version = "your.version.number",
.dependencies = .{
.genAlg = .{
.url = "https://github.com/StrandedSoftwareDeveloper/zigGenAlg/archive/<latest commit hash>.tar.gz",
}
},
}
```
- Add this to your build.zig:
```
const gen_alg_mod = b.dependency("genAlg", .{ .target = target, .optimize = optimize }).module("genAlg");
exe.addModule("genAlg", gen_alg_mod);
```
- And import it with this:
```
const genAlg = @import("genAlg");
```

0 comments on commit 4c365dc

Please sign in to comment.