diff options
author | 2022-12-30 22:37:28 -0800 | |
---|---|---|
committer | 2022-12-30 22:37:28 -0800 | |
commit | b86915c80819e61e6e1932d7802a4c31c73094e9 (patch) | |
tree | 64e258faff58f47a0150a30c903d1ff1ebd47709 | |
parent | be706fecb4c74a6c234c2a8b6b29d6afbd74ecfa (diff) | |
download | bun-b86915c80819e61e6e1932d7802a4c31c73094e9.tar.gz bun-b86915c80819e61e6e1932d7802a4c31c73094e9.tar.zst bun-b86915c80819e61e6e1932d7802a4c31c73094e9.zip |
[internal] Add flag to build bun for editor error reporting
-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); } |