-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathbuild.zig.zon
More file actions
92 lines (92 loc) · 3.26 KB
/
build.zig.zon
File metadata and controls
92 lines (92 loc) · 3.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
.{
.name = .zapi,
.version = "2.2.0", // x-release-please-version
.fingerprint = 0x77829ef951b38aac,
.minimum_zig_version = "0.16.0",
.paths = .{ "build.zig", "build.zig.zon", "src", "include" },
.dependencies = .{
.zbuild = .{
.url = "git+https://github.com/ChainSafe/zbuild?ref=refactor/comptime-library-rewrite#7ec852f1c6495b62d964e311bd210b6f9a3015be",
.hash = "zbuild-0.4.0-XJFav9lXAgCtcFwxSb5qEkex3kijECLtqo7z9FzrkUaf",
},
},
.options_modules = .{
.build_options = .{
.napi_version = .{
.type = .string,
.default = "10",
.description = "Node.js NAPI version (default: 10).",
},
},
},
.modules = .{
// `napi` and `zapi` share the same source file but expose different
// imports — `napi` is used by `napi.zig`-only consumers, while `zapi`
// links libc and is the canonical entry point for example modules.
.napi = .{
.root_source_file = "src/root.zig",
.include_paths = .{"include"},
.imports = .{.build_options},
},
.zapi = .{
.root_source_file = "src/root.zig",
.include_paths = .{"include"},
.imports = .{.build_options},
.link_libc = true,
},
.example_hello_world = .{
.root_source_file = "examples/hello_world/mod.zig",
.imports = .{.zapi},
.link_libc = true,
},
.example_type_tag = .{
.root_source_file = "examples/type_tag/mod.zig",
.imports = .{.zapi},
.link_libc = true,
},
.example_js_dsl = .{
.root_source_file = "examples/js_dsl/mod.zig",
.imports = .{.zapi},
.link_libc = true,
},
},
.libraries = .{
.example_hello_world = .{
.root_module = .example_hello_world,
.linkage = .dynamic,
.linker_allow_shlib_undefined = true,
.dest_sub_path = "example_hello_world.node",
},
.example_type_tag = .{
.root_module = .example_type_tag,
.linkage = .dynamic,
.linker_allow_shlib_undefined = true,
.dest_sub_path = "example_type_tag.node",
},
.example_js_dsl = .{
.root_module = .example_js_dsl,
.linkage = .dynamic,
.linker_allow_shlib_undefined = true,
.dest_sub_path = "example_js_dsl.node",
},
},
.tests = .{
.napi = .{ .root_module = .napi },
.zapi = .{ .root_module = .zapi },
// Example tests reference napi C symbols (`napi_wrap`, `napi_typeof`, …)
// which Node provides at dlopen time. Standalone zig test binaries don't
// have Node around, so allow undefined shared-library symbols.
.example_hello_world = .{
.root_module = .example_hello_world,
.linker_allow_shlib_undefined = true,
},
.example_type_tag = .{
.root_module = .example_type_tag,
.linker_allow_shlib_undefined = true,
},
.example_js_dsl = .{
.root_module = .example_js_dsl,
.linker_allow_shlib_undefined = true,
},
},
}