| ... | @@ -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 | ``` |
| 91 | | 91 | |
| | 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 Art | 114 | ## Prior Art |
| 93 | - https://golang.org/ref/mod#go-mod-file | 115 | - https://golang.org/ref/mod#go-mod-file |
| 94 | - https://github.com/mattnite/zkg | 116 | - https://github.com/mattnite/zkg |