| ... | @@ -1341,6 +1341,7 @@ pub const LibExeObjStep = struct { | ... | @@ -1341,6 +1341,7 @@ pub const LibExeObjStep = struct { |
| 1341 | name_only_filename: []const u8, | 1341 | name_only_filename: []const u8, |
| 1342 | strip: bool, | 1342 | strip: bool, |
| 1343 | lib_paths: ArrayList([]const u8), | 1343 | lib_paths: ArrayList([]const u8), |
| | 1344 | rpaths: ArrayList([]const u8), |
| 1344 | framework_dirs: ArrayList([]const u8), | 1345 | framework_dirs: ArrayList([]const u8), |
| 1345 | frameworks: BufSet, | 1346 | frameworks: BufSet, |
| 1346 | verbose_link: bool, | 1347 | verbose_link: bool, |
| ... | @@ -1536,6 +1537,7 @@ pub const LibExeObjStep = struct { | ... | @@ -1536,6 +1537,7 @@ pub const LibExeObjStep = struct { |
| 1536 | .link_objects = ArrayList(LinkObject).init(builder.allocator), | 1537 | .link_objects = ArrayList(LinkObject).init(builder.allocator), |
| 1537 | .c_macros = ArrayList([]const u8).init(builder.allocator), | 1538 | .c_macros = ArrayList([]const u8).init(builder.allocator), |
| 1538 | .lib_paths = ArrayList([]const u8).init(builder.allocator), | 1539 | .lib_paths = ArrayList([]const u8).init(builder.allocator), |
| | 1540 | .rpaths = ArrayList([]const u8).init(builder.allocator), |
| 1539 | .framework_dirs = ArrayList([]const u8).init(builder.allocator), | 1541 | .framework_dirs = ArrayList([]const u8).init(builder.allocator), |
| 1540 | .object_src = undefined, | 1542 | .object_src = undefined, |
| 1541 | .build_options_contents = std.ArrayList(u8).init(builder.allocator), | 1543 | .build_options_contents = std.ArrayList(u8).init(builder.allocator), |
| ... | @@ -2072,6 +2074,10 @@ pub const LibExeObjStep = struct { | ... | @@ -2072,6 +2074,10 @@ pub const LibExeObjStep = struct { |
| 2072 | self.lib_paths.append(self.builder.dupe(path)) catch unreachable; | 2074 | self.lib_paths.append(self.builder.dupe(path)) catch unreachable; |
| 2073 | } | 2075 | } |
| 2074 | | 2076 | |
| | 2077 | pub fn addRPath(self: *LibExeObjStep, path: []const u8) void { |
| | 2078 | self.rpaths.append(self.builder.dupe(path)) catch unreachable; |
| | 2079 | } |
| | 2080 | |
| 2075 | pub fn addFrameworkDir(self: *LibExeObjStep, dir_path: []const u8) void { | 2081 | pub fn addFrameworkDir(self: *LibExeObjStep, dir_path: []const u8) void { |
| 2076 | self.framework_dirs.append(self.builder.dupe(dir_path)) catch unreachable; | 2082 | self.framework_dirs.append(self.builder.dupe(dir_path)) catch unreachable; |
| 2077 | } | 2083 | } |
| ... | @@ -2568,6 +2574,11 @@ pub const LibExeObjStep = struct { | ... | @@ -2568,6 +2574,11 @@ pub const LibExeObjStep = struct { |
| 2568 | try zig_args.append(lib_path); | 2574 | try zig_args.append(lib_path); |
| 2569 | } | 2575 | } |
| 2570 | | 2576 | |
| | 2577 | for (self.rpaths.items) |rpath| { |
| | 2578 | try zig_args.append("-rpath"); |
| | 2579 | try zig_args.append(rpath); |
| | 2580 | } |
| | 2581 | |
| 2571 | for (self.c_macros.items) |c_macro| { | 2582 | for (self.c_macros.items) |c_macro| { |
| 2572 | try zig_args.append("-D"); | 2583 | try zig_args.append("-D"); |
| 2573 | try zig_args.append(c_macro); | 2584 | try zig_args.append(c_macro); |