-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.zig
More file actions
167 lines (141 loc) · 4.74 KB
/
build.zig
File metadata and controls
167 lines (141 loc) · 4.74 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
const std = @import("std");
pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
const test_step = b.step("test", "Run all tests");
const test_filters = b.option([]const String, "test-filter", "Filters for which tests to run") orelse &.{};
// Test packages
const test_fuzzy = b.addTest(.{
.name = "fuzzy_test",
.target = target,
.optimize = optimize,
});
test_fuzzy.addRootSourceFile("cli/test/fuzzy_test.zig");
test_fuzzy.addRootSourceFile("cli/src/fuzzy.zig");
test_fuzzy.linkLibC();
const run_fuzzy = b.addRunArtifact(test_fuzzy);
test_step.dependOn(&run_fuzzy.step);
const test_grep = b.addTest(.{
.name = "grep_test",
.target = target,
.optimize = optimize,
});
test_grep.addRootSourceFile("cli/test/grep_test.zig");
test_grep.addRootSourceFile("cli/src/grep.zig");
test_grep.linkLibC();
const run_grep = b.addRunArtifact(test_grep);
test_step.dependOn(&run_grep.step);
const test_pick = b.addTest(.{
.name = "pick_test",
.target = target,
.optimize = optimize,
});
test_pick.addRootSourceFile("cli/test/pick_test.zig");
test_pick.linkLibC();
const run_pick = b.addRunArtifact(test_pick);
test_step.dependOn(&run_pick.step);
const test_task = b.addTest(.{
.name = "task_test",
.target = target,
.optimize = optimize,
});
test_task.addRootSourceFile("cli/test/task_test.zig");
test_task.linkLibC();
const run_task = b.addRunArtifact(test_task);
test_step.dependOn(&run_task.step);
const test_buffer = b.addTest(.{
.name = "buffer_test",
.target = target,
.optimize = optimize,
});
test_buffer.addRootSourceFile("cli/test/buffer_test.zig");
test_buffer.linkLibC();
const run_buffer = b.addRunArtifact(test_buffer);
test_step.dependOn(&run_buffer.step);
const test_lsp = b.addTest(.{
.name = "lsp_test",
.target = target,
.optimize = optimize,
});
test_lsp.addRootSourceFile("cli/test/lsp_test.zig");
test_lsp.addRootSourceFile("cli/src/lsp.zig");
test_lsp.linkLibC();
const run_lsp = b.addRunArtifact(test_lsp);
test_step.dependOn(&run_lsp.step);
const test_bookmark = b.addTest(.{
.name = "bookmark_test",
.target = target,
.optimize = optimize,
});
test_bookmark.addRootSourceFile("cli/test/bookmark_test.zig");
test_bookmark.linkLibC();
const run_bookmark = b.addRunArtifact(test_bookmark);
test_step.dependOn(&run_bookmark.step);
// Executables
const fuzzy_exe = b.addExecutable(.{
.name = "nvim-fuzzy",
.target = target,
.optimize = optimize,
});
fuzzy_exe.addRootSourceFile("cli/src/fuzzy.zig");
fuzzy_exe.linkLibC();
fuzzy_exe.installArtifact(fuzzy_exe);
const grep_exe = b.addExecutable(.{
.name = "nvim-grep",
.target = target,
.optimize = optimize,
});
grep_exe.addRootSourceFile("cli/src/grep.zig");
grep_exe.linkLibC();
grep_exe.installArtifact(grep_exe);
const pick_exe = b.addExecutable(.{
.name = "nvim-pick",
.target = target,
.optimize = optimize,
});
pick_exe.addRootSourceFile("cli/src/pick.zig");
pick_exe.linkLibC();
pick_exe.installArtifact(pick_exe);
const fzf_exe = b.addExecutable(.{
.name = "nvim-fzf",
.target = target,
.optimize = optimize,
});
fzf_exe.addRootSourceFile("cli/src/fzf.zig");
fzf_exe.linkLibC();
fzf_exe.installArtifact(fzf_exe);
const task_exe = b.addExecutable(.{
.name = "nvim-task",
.target = target,
.optimize = optimize,
});
task_exe.addRootSourceFile("cli/src/task.zig");
task_exe.linkLibC();
task_exe.installArtifact(task_exe);
const buffer_exe = b.addExecutable(.{
.name = "nvim-buffer",
.target = target,
.optimize = optimize,
});
buffer_exe.addRootSourceFile("cli/src/buffer.zig");
buffer_exe.linkLibC();
buffer_exe.installArtifact(buffer_exe);
const lsp_exe = b.addExecutable(.{
.name = "nvim-lsp",
.target = target,
.optimize = optimize,
});
lsp_exe.addRootSourceFile("cli/src/lsp.zig");
lsp_exe.linkLibC();
lsp_exe.installArtifact(lsp_exe);
const bookmark_exe = b.addExecutable(.{
.name = "nvim-bookmark",
.target = target,
.optimize = optimize,
});
bookmark_exe.addRootSourceFile("cli/src/bookmark.zig");
bookmark_exe.linkLibC();
bookmark_exe.installArtifact(bookmark_exe);
b.step("all", "Build all CLI tools").dependOn(&fuzzy_exe.step);
}
const String = []const u8;