From 6702a167ca92115c93204a885403e53122770e4c Mon Sep 17 00:00:00 2001 From: Meghan Date: Sun, 29 Nov 2020 04:18:39 -0800 Subject: [PATCH] README- add zig.mod reference docs --- README.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/README.md b/README.md index bf4e63c89d1a089c9dbf21672403de85c95b46d5..37d137e56d50916c45a2c041111bc9d821cc1fa0 100644 --- a/README.md +++ b/README.md @@ -89,6 +89,28 @@ pub fn build(b: *Builder) void { exe.install(); ``` +### `zig.mod` Reference +| Name | Type | Note | Description | +|------|------|------|-------------| +| `name` | `string` | required | The value users will put into `@import` | +| `main` | `string` | required | The `.zig` entry point into your package | +| `c_include_dirs` | `[]string` | | A list of relative paths to directories with `.h` files | +| `c_source_flags` | `[]string` | | A list of clang flags to pass to each of the `.c` files in `c_source_files` | +| `c_source_files` | `[]string` | | A list of relative paths to `.c` files to compile along with project | +| `dependencies` | `[]Dep` | | An array of dependency objects | + +#### Dep object +| Name | Type | Note | Description | +|------|------|------|-------------| +| `type` | `string` | required, enum | One of `git`, `hg` | +| `path` | `string` | required | URL/path to this dependency. depends on the type | +| `version` | `string` | only on some types | pin this dependency at a specific version | +| `only_os` | `string` | | comma separated list of OS names to add this Dep to | +| `except_os` | `string` | | comma separated list of OS names to exclude this Dep from | + +- `name`, `main`, `c_include_dirs`, `c_source_flags`, `c_source_files`, can be overwritten as well. +- `type.git` supports version pinning by `branch-XX`, `tag-XX`, and `commit-XX`. + ## Prior Art - https://golang.org/ref/mod#go-mod-file - https://github.com/mattnite/zkg -- 2.54.0