-
Notifications
You must be signed in to change notification settings - Fork 11
/
build.zig
53 lines (40 loc) · 1.54 KB
/
build.zig
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
const std = @import("std");
pub fn build(b: *std.Build) void {
_ = b.addModule("treez", .{
.root_source_file = b.path("treez.zig"),
});
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
b.installArtifact(b.dependency("tree-sitter", .{
.target = target,
.optimize = optimize,
}).artifact("tree-sitter"));
// Example
// const exe = b.addExecutable(.{
// .name = "treez-example",
// // In this case the main source file is merely a path, however, in more
// // complicated build scripts, this could be a generated file.
// .root_source_file = b.path("example/example.zig"),
// .target = target,
// .optimize = optimize,
// });
// Added module import for example to use directly, requires changing _ = to const treez = at the top
// exe.root_module.addImport("treez", treez);
// exe.linkLibC();
// exe.linkLibrary(b.dependency("tree-sitter", .{
// .target = target,
// .optimize = optimize,
// }).artifact("tree-sitter"));
// exe.linkLibrary(b.dependency("tree-sitter-zig", .{
// .target = target,
// .optimize = optimize,
// }).artifact("tree-sitter-zig"));
// b.installArtifact(exe);
// const run_cmd = b.addRunArtifact(exe);
// run_cmd.step.dependOn(b.getInstallStep());
// if (b.args) |args| {
// run_cmd.addArgs(args);
// }
// const run_step = b.step("example", "Run the example");
// run_step.dependOn(&run_cmd.step);
}