build: don't skip compiler build with -Dno-bin

This option exists for fast iteration during compiler development, since
avoiding codegen (but still performing semantic analysis) causes compile
errors to appear around twice as fast. This option was broken when the
`emit_bin` property on `std.Build.Step.Compile` was removed.

Now, when this option is passed, we add a direct install dependency on
the compile step itself, so that it is always run.
This commit is contained in:
mlugg 2023-09-14 22:49:30 +01:00
parent 1a0e6bcdb1
commit 6a349648cb
No known key found for this signature in database
GPG Key ID: 58978E823BDE3EF9

View File

@ -204,7 +204,9 @@ pub fn build(b: *std.Build) !void {
"Request creation of '.note.gnu.build-id' section",
);
if (!no_bin) {
if (no_bin) {
b.getInstallStep().dependOn(&exe.step);
} else {
const install_exe = b.addInstallArtifact(exe, .{
.dest_dir = if (flat) .{ .override = .prefix } else .default,
});