authorgravatar for hello@nektro.netMeghan <hello@nektro.net> 2020-11-29 04:18:39 -08:00
committergravatar for hello@nektro.netMeghan <hello@nektro.net> 2020-11-29 04:18:39 -08:00
log6702a167ca92115c93204a885403e53122770e4c
tree216d3ea8a1a6072549dc853aec08934eadab1083
parent346ad7b89a2eb1fce88ea59caa0209e266ef40b0

README- add zig.mod reference docs


1 files changed, 22 insertions(+), 0 deletions(-)

README.md+22
...@@ -89,6 +89,28 @@ pub fn build(b: *Builder) void {...@@ -89,6 +89,28 @@ pub fn build(b: *Builder) void {
89 exe.install();89 exe.install();
90```90```
9191
92### `zig.mod` Reference
93| Name | Type | Note | Description |
94|------|------|------|-------------|
95| `name` | `string` | required | The value users will put into `@import` |
96| `main` | `string` | required | The `.zig` entry point into your package |
97| `c_include_dirs` | `[]string` | | A list of relative paths to directories with `.h` files |
98| `c_source_flags` | `[]string` | | A list of clang flags to pass to each of the `.c` files in `c_source_files` |
99| `c_source_files` | `[]string` | | A list of relative paths to `.c` files to compile along with project |
100| `dependencies` | `[]Dep` | | An array of dependency objects |
101
102#### Dep object
103| Name | Type | Note | Description |
104|------|------|------|-------------|
105| `type` | `string` | required, enum | One of `git`, `hg` |
106| `path` | `string` | required | URL/path to this dependency. depends on the type |
107| `version` | `string` | only on some types | pin this dependency at a specific version |
108| `only_os` | `string` | | comma separated list of OS names to add this Dep to |
109| `except_os` | `string` | | comma separated list of OS names to exclude this Dep from |
110
111- `name`, `main`, `c_include_dirs`, `c_source_flags`, `c_source_files`, can be overwritten as well.
112- `type.git` supports version pinning by `branch-XX`, `tag-XX`, and `commit-XX`.
113
92## Prior Art114## Prior Art
93- https://golang.org/ref/mod#go-mod-file115- https://golang.org/ref/mod#go-mod-file
94- https://github.com/mattnite/zkg116- https://github.com/mattnite/zkg