Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions compile_commands.zig
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const std = @import("std");

// here's the static memory!!!!
var compile_steps: ?[]*std.Build.Step.Compile = null;
var compile_steps: ?[]const *std.Build.Step.Compile = null;

const CSourceFiles = std.Build.Module.CSourceFiles;

Expand All @@ -18,7 +18,7 @@ const CompileCommandEntry = struct {
output: []const u8,
};

pub fn createStep(b: *std.Build, name: []const u8, targets: []*std.Build.Step.Compile) *std.Build.Step {
pub fn createStep(b: *std.Build, name: []const u8, targets: []const *std.Build.Step.Compile) *std.Build.Step {
const step = b.allocator.create(std.Build.Step) catch @panic("Allocation failure, probably OOM");

compile_steps = targets;
Expand All @@ -30,6 +30,8 @@ pub fn createStep(b: *std.Build, name: []const u8, targets: []*std.Build.Step.Co
.owner = b,
});

for (targets) |target| step.dependOn(&target.step);

const cdb_step = b.step(name, "Create compile_commands.json");
cdb_step.dependOn(step);

Expand Down