add zig package manager help to readme
This commit is contained in:
parent
4ed231aa52
commit
ac7f67f0ee
23
readme.md
23
readme.md
@ -8,6 +8,29 @@ It seams that most other websocket implementations are using zlib for deflate.
|
|||||||
[zlib 1.2.13 Manual](https://www.zlib.net/manual.html)
|
[zlib 1.2.13 Manual](https://www.zlib.net/manual.html)
|
||||||
|
|
||||||
|
|
||||||
|
### Link
|
||||||
|
There is empty zig project (made with 'zig init-exe') in [example/exe](example/exe) which illustrates how to link zlib library using zig package manager.
|
||||||
|
|
||||||
|
Add dependency in build.zig.zon:
|
||||||
|
```zig
|
||||||
|
.dependencies = .{
|
||||||
|
.zlib = .{
|
||||||
|
.url = "https://github.com/ianic/zig-zlib/archive/9186b0f5fdfd6c29cd04f7ada7b0113fe1f63611.tar.gz",
|
||||||
|
.hash = "122001cc3da638f9315f08fb51fe5aace68c254b59bcac3457e20d746565bad7fe04",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
```
|
||||||
|
In build.zig link 'z' library and 'zlib' module:
|
||||||
|
```zig
|
||||||
|
// Link z library and zlib module.
|
||||||
|
exe.linkLibrary(b.dependency("zlib", .{
|
||||||
|
.target = target,
|
||||||
|
.optimize = optimize,
|
||||||
|
}).artifact("z"));
|
||||||
|
exe.addModule("zlib", zlib.module("zlib"));
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
### Notes
|
### Notes
|
||||||
|
|
||||||
get zlib source into zlib folder:
|
get zlib source into zlib folder:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user