@@ -34,8 +34,15 @@ pub fn build(b: *std.Build) !void {
3434 .root_source_file = b .path ("src/cli.zig" ),
3535 .target = target ,
3636 .optimize = optimize ,
37+ .single_threaded = true ,
3738 });
3839
40+ const verbose_logging = b .option (bool , "log" , "Enable verbose logging also in release modes" ) orelse false ;
41+ const scopes = b .option ([]const []const u8 , "scope" , "Enable this scope (all scopes are enabled when none is specified through this option), can be used multiple times" ) orelse &[0 ][]const u8 {};
42+ const options = b .addOptions ();
43+ options .addOption (bool , "verbose_logging" , verbose_logging );
44+ options .addOption ([]const []const u8 , "enabled_scopes" , scopes );
45+
3946 const folders = b .dependency ("known-folders" , .{});
4047 const lsp = b .dependency ("zig-lsp-kit" , .{});
4148
@@ -45,6 +52,7 @@ pub fn build(b: *std.Build) !void {
4552 folders .module ("known-folders" ),
4653 );
4754 super_cli .root_module .addImport ("lsp" , lsp .module ("lsp" ));
55+ super_cli .root_module .addOptions ("build_options" , options );
4856
4957 const run_exe = b .addRunArtifact (super_cli );
5058 if (b .args ) | args | run_exe .addArgs (args );
@@ -66,6 +74,7 @@ pub fn build(b: *std.Build) !void {
6674 folders .module ("known-folders" ),
6775 );
6876 super_cli_check .root_module .addImport ("lsp" , lsp .module ("lsp" ));
77+ super_cli_check .root_module .addOptions ("build_options" , options );
6978
7079 const check = b .step ("check" , "Check if Super compiles" );
7180 check .dependOn (& super_cli_check .step );
@@ -105,6 +114,7 @@ pub fn build(b: *std.Build) !void {
105114 folders .module ("known-folders" ),
106115 );
107116 super_exe_release .root_module .addImport ("lsp" , lsp .module ("lsp" ));
117+ super_exe_release .root_module .addOptions ("build_options" , options );
108118
109119 const target_output = b .addInstallArtifact (super_exe_release , .{
110120 .dest_dir = .{
@@ -133,6 +143,7 @@ pub fn build(b: *std.Build) !void {
133143
134144 super_wasm_lsp .root_module .addImport ("super" , super );
135145 super_wasm_lsp .root_module .addImport ("lsp" , lsp .module ("lsp" ));
146+ super_wasm_lsp .root_module .addOptions ("build_options" , options );
136147
137148 const wasm = b .step ("wasm" , "Generate WASM Build of the LSP for VSCode" );
138149 const target_output = b .addInstallArtifact (super_wasm_lsp , .{
0 commit comments