@@ -49,7 +49,7 @@ pub fn build(b: *std.Build) !void {
4949 options .addOption (Version .Kind , "version_kind" , version );
5050
5151 const folders = b .dependency ("known_folders" , .{});
52- const lsp = b .dependency ("lsp_codegen " , .{});
52+ const lsp = b .dependency ("lsp_kit " , .{});
5353
5454 const check = setupCheckStep (b , target , optimize , options , superhtml , folders , lsp );
5555 setupTestStep (b , target , superhtml , check );
@@ -80,9 +80,11 @@ fn setupCheckStep(
8080 const check = b .step ("check" , "Check if the SuperHTML CLI compiles" );
8181 const super_cli_check = b .addExecutable (.{
8282 .name = "superhtml" ,
83- .root_source_file = b .path ("src/cli.zig" ),
84- .target = target ,
85- .optimize = optimize ,
83+ .root_module = b .createModule (.{
84+ .root_source_file = b .path ("src/cli.zig" ),
85+ .target = target ,
86+ .optimize = optimize ,
87+ }),
8688 });
8789
8890 super_cli_check .root_module .addImport ("superhtml" , superhtml );
@@ -107,8 +109,6 @@ fn setupTestStep(
107109
108110 const unit_tests = b .addTest (.{
109111 .root_module = superhtml ,
110- .target = target ,
111- .optimize = .Debug ,
112112 // .strip = true,
113113 // .filter = "if-else-loop",
114114 });
@@ -117,9 +117,11 @@ fn setupTestStep(
117117 test_step .dependOn (& run_unit_tests .step );
118118
119119 const fuzz_tests = b .addTest (.{
120- .root_source_file = b .path ("src/fuzz.zig" ),
121- .target = target ,
122- .optimize = .Debug ,
120+ .root_module = b .createModule (.{
121+ .root_source_file = b .path ("src/fuzz.zig" ),
122+ .target = target ,
123+ .optimize = .Debug ,
124+ }),
123125 // .strip = true,
124126 // .filter = "nesting",
125127 });
@@ -137,9 +139,11 @@ fn setupFuzzStep(
137139 const afl = b .lazyImport (@This (), "afl_kit" ) orelse return ;
138140 const afl_obj = b .addObject (.{
139141 .name = "superfuzz-afl" ,
140- .root_source_file = b .path ("src/fuzz/afl.zig" ),
141- .target = target ,
142- .optimize = .ReleaseSafe ,
142+ .root_module = b .createModule (.{
143+ .root_source_file = b .path ("src/fuzz/afl.zig" ),
144+ .target = target ,
145+ .optimize = .ReleaseSafe ,
146+ }),
143147 });
144148
145149 afl_obj .root_module .addImport ("superhtml" , superhtml );
@@ -159,19 +163,23 @@ fn setupFuzzStep(
159163
160164 const super_fuzz = b .addExecutable (.{
161165 .name = "superfuzz" ,
162- .root_source_file = b .path ("src/fuzz.zig" ),
163- .target = target ,
164- .optimize = .ReleaseSafe ,
166+ .root_module = b .createModule (.{
167+ .root_source_file = b .path ("src/fuzz.zig" ),
168+ .target = target ,
169+ .optimize = .ReleaseSafe ,
170+ }),
165171 });
166172
167173 super_fuzz .root_module .addImport ("superhtml" , superhtml );
168174 b .installArtifact (super_fuzz );
169175
170176 const supergen = b .addExecutable (.{
171177 .name = "supergen" ,
172- .root_source_file = b .path ("src/fuzz/astgen.zig" ),
173- .target = target ,
174- .optimize = .Debug ,
178+ .root_module = b .createModule (.{
179+ .root_source_file = b .path ("src/fuzz/astgen.zig" ),
180+ .target = target ,
181+ .optimize = .Debug ,
182+ }),
175183 });
176184
177185 supergen .root_module .addImport ("superhtml" , superhtml );
@@ -189,10 +197,12 @@ fn setupCliTool(
189197) void {
190198 const super_cli = b .addExecutable (.{
191199 .name = "superhtml" ,
192- .root_source_file = b .path ("src/cli.zig" ),
193- .target = target ,
194- .optimize = optimize ,
195- .single_threaded = true ,
200+ .root_module = b .createModule (.{
201+ .root_source_file = b .path ("src/cli.zig" ),
202+ .target = target ,
203+ .optimize = optimize ,
204+ .single_threaded = true ,
205+ }),
196206 });
197207
198208 super_cli .root_module .addImport ("superhtml" , superhtml );
@@ -221,14 +231,16 @@ fn setupWasmStep(
221231 const wasm = b .step ("wasm" , "Generate a WASM build of the SuperHTML LSP for VSCode" );
222232 const super_wasm_lsp = b .addExecutable (.{
223233 .name = "superhtml" ,
224- .root_source_file = b .path ("src/wasm.zig" ),
225- .target = b .resolveTargetQuery (.{
226- .cpu_arch = .wasm32 ,
227- .os_tag = .wasi ,
234+ .root_module = b .createModule (.{
235+ .root_source_file = b .path ("src/wasm.zig" ),
236+ .target = b .resolveTargetQuery (.{
237+ .cpu_arch = .wasm32 ,
238+ .os_tag = .wasi ,
239+ }),
240+ .optimize = optimize ,
241+ .single_threaded = true ,
242+ .link_libc = false ,
228243 }),
229- .optimize = optimize ,
230- .single_threaded = true ,
231- .link_libc = false ,
232244 });
233245
234246 super_wasm_lsp .root_module .addImport ("superhtml" , superhtml );
@@ -266,9 +278,11 @@ fn setupReleaseStep(
266278
267279 const super_exe_release = b .addExecutable (.{
268280 .name = "superhtml" ,
269- .root_source_file = b .path ("src/cli.zig" ),
270- .target = release_target ,
271- .optimize = .ReleaseFast ,
281+ .root_module = b .createModule (.{
282+ .root_source_file = b .path ("src/cli.zig" ),
283+ .target = release_target ,
284+ .optimize = .ReleaseFast ,
285+ }),
272286 });
273287
274288 super_exe_release .root_module .addImport ("superhtml" , superhtml );
@@ -294,14 +308,16 @@ fn setupReleaseStep(
294308 {
295309 const super_wasm_lsp = b .addExecutable (.{
296310 .name = "superhtml" ,
297- .root_source_file = b .path ("src/wasm.zig" ),
298- .target = b .resolveTargetQuery (.{
299- .cpu_arch = .wasm32 ,
300- .os_tag = .wasi ,
311+ .root_module = b .createModule (.{
312+ .root_source_file = b .path ("src/wasm.zig" ),
313+ .target = b .resolveTargetQuery (.{
314+ .cpu_arch = .wasm32 ,
315+ .os_tag = .wasi ,
316+ }),
317+ .optimize = .ReleaseSmall ,
318+ .single_threaded = true ,
319+ .link_libc = false ,
301320 }),
302- .optimize = .ReleaseSmall ,
303- .single_threaded = true ,
304- .link_libc = false ,
305321 });
306322
307323 super_wasm_lsp .root_module .addImport ("superhtml" , superhtml );
0 commit comments