mirror of
https://github.com/ziglang/zig.git
synced 2026-02-20 08:14:48 +00:00
build: when parsing rpaths, do not expand special runtime paths on Darwin
Special runtime paths on Darwin are: `@executable_path` and `@loader_path`.
This commit is contained in:
parent
38ee46dda3
commit
5d2892740a
@ -1725,6 +1725,22 @@ fn make(step: *Step, prog_node: *std.Progress.Node) !void {
|
||||
try zig_args.ensureUnusedCapacity(2 * self.rpaths.items.len);
|
||||
for (self.rpaths.items) |rpath| {
|
||||
zig_args.appendAssumeCapacity("-rpath");
|
||||
|
||||
if (self.target_info.target.isDarwin()) switch (rpath) {
|
||||
.path => |path| {
|
||||
// On Darwin, we should not try to expand special runtime paths such as
|
||||
// * @executable_path
|
||||
// * @loader_path
|
||||
if (mem.startsWith(u8, path, "@executable_path") or
|
||||
mem.startsWith(u8, path, "@loader_path"))
|
||||
{
|
||||
zig_args.appendAssumeCapacity(path);
|
||||
continue;
|
||||
}
|
||||
},
|
||||
.generated => {},
|
||||
};
|
||||
|
||||
zig_args.appendAssumeCapacity(rpath.getPath2(b, step));
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user