Skip to content
Merged
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
12 changes: 10 additions & 2 deletions toolchain/zig-wrapper.zig
Original file line number Diff line number Diff line change
Expand Up @@ -302,9 +302,17 @@ fn resolveColonLibraries(
args: *ArrayListUnmanaged([]const u8),
) error{OutOfMemory}!void {
var lib_paths = ArrayListUnmanaged([]const u8){};
for (args.items) |arg| {
if (mem.startsWith(u8, arg, "-L") and arg.len > 2)
var j: usize = 0;
while (j < args.items.len) : (j += 1) {
const arg = args.items[j];
// Bazel passes the search path as a separate argument ("-L" "path");
// other callers may fuse them ("-Lpath"). Collect both forms.
if (mem.eql(u8, arg, "-L") and j + 1 < args.items.len) {
j += 1;
try lib_paths.append(arena, args.items[j]);
} else if (mem.startsWith(u8, arg, "-L") and arg.len > 2) {
try lib_paths.append(arena, arg[2..]);
}
}

var i: usize = 0;
Expand Down
Loading