authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-02-26 11:34:06 -08:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-02-26 11:34:06 -08:00
logb61cdb619841370d47bb2e94dffe2bf1a8f99e68
tree1fe19121c1a04ffd2d2aa92d421806bcfdd84c39
parent3614ac688862532e33789a60ed34275fc1cb8398

docs- add deps.zig reference


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

docs/deps.zig.md created+50
......@@ -0,0 +1,50 @@
1## `deps.zig` Reference
2This file is generated by [`zigmod fetch`](commands/fetch.md) and is an amalgamation of all of the sources and dependencies used in this project. Many of the fields listed here align with fields present in [`zig.mod`](zig.mod.md) but contain those values for the entire tree.
3
4### `cache`
5- Type: `[]const u8`
6The relative path root to which all dependency sources are saved. Currently always `.zigmod/deps`.
7
8### `addAllTo`
9- Type: `pub fn (exe: *build.LibExeObjStep) void`
10A helper function to add all of the packages, C files, and system libraries to the passed exectuable. It will also automatically link libC in the event that any C files are found in the dependency tree.
11
12### `_ids`
13- Type: `[][]const u8`
14A comptime-known string array of all of the [ID's](zig.mod.md#id) used in this project.
15
16### `_paths`
17- Type: `[][]const u8`
18A comptime-known string array of the source paths to each dependency relative to `cache`.
19
20### `package_data`
21- Type: `struct<ID, std.build.Pkg>`
22This is a meta struct that associates ID's to their relavant `std.build.Pkg` initialization, complete with sub-packages and all.
23
24### `packages`
25- Type: `[]std.build.Pkg`
26This is a an array of all of the items in `package_data`, but able to be referenced by index, rather than package ID.
27
28### `pkgs`
29- Type: `struct<NAME, std.build.Pkg>`
30This is a struct that associates the package name to the relavant `std.build.Pkg`. The only packages listed are the dependencies of the root project. Additionally, the data here can be referenced to use dependencies at build time in `build.zig` through importing the path of the project like so:
31```zig
32const deps = @import("./deps.zig");
33const my_dev_dep = @import(deps.pkgs.my_dev_dep.path);
34```
35
36### `c_include_dirs`
37- Type: `[][]const u8`
38An ensembled list of all the `c_include_dirs` lists.
39
40### `c_source_flags`
41- Type: `struct<ID, []const u8>`
42An ensembled list of all the `c_source_flags` lists.
43
44### `c_source_files`
45- Type: `[][2][]const u8`
46An ensembled list of all the `c_source_files` lists.
47
48### `system_libs`
49- Type: `[][]const u8`
50An ensembled list of all the `system_libs` lists.