diff options
-rw-r--r-- | .vscode/settings.json | 3 | ||||
-rw-r--r-- | build.zig | 7 |
2 files changed, 9 insertions, 1 deletions
diff --git a/.vscode/settings.json b/.vscode/settings.json index 2e8283ca1..76ccb4cee 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -7,6 +7,9 @@ "search.followSymlinks": false, "search.useIgnoreFiles": true, "zig.buildOnSave": false, + "zig.buildArgs": ["obj", "-Dfor-editor"], + "zig.buildOption": "build", + "zig.buildFilePath": "${workspaceFolder}/build.zig", "[zig]": { "editor.tabSize": 4, "editor.useTabStops": false, @@ -330,6 +330,10 @@ pub fn build(b: *std.build.Builder) !void { obj.bundle_compiler_rt = true; obj.omit_frame_pointer = mode != .Debug; + if (b.option(bool, "for-editor", "Do not emit bin, just check for errors") orelse false) { + obj.emit_bin = .no_emit; + } + if (target.getOsTag() == .linux) { // obj.want_lto = tar; obj.link_emit_relocs = true; @@ -468,7 +472,8 @@ pub fn build(b: *std.build.Builder) !void { headers_step.dependOn(&after.step); } } - obj.setOutputDir(output_dir); + if (obj.emit_bin != .no_emit) + obj.setOutputDir(output_dir); b.default_step.dependOn(obj_step); } |