mirror of
https://github.com/ziglang/zig.git
synced 2026-02-13 04:48:20 +00:00
Merge pull request #8773 from ziglang/macho-dsym-path
macho: put dSYM bundle in zig-cache
This commit is contained in:
commit
1e5e664555
@ -363,18 +363,30 @@ pub fn openPath(allocator: *Allocator, sub_path: []const u8, options: link.Optio
|
||||
self.base.file = file;
|
||||
|
||||
// Create dSYM bundle.
|
||||
const d_sym_path = try fmt.allocPrint(allocator, "{s}.dSYM/Contents/Resources/DWARF/", .{sub_path});
|
||||
defer allocator.free(d_sym_path);
|
||||
var d_sym_bundle = try options.emit.?.directory.handle.makeOpenPath(d_sym_path, .{});
|
||||
defer d_sym_bundle.close();
|
||||
const d_sym_file = try d_sym_bundle.createFile(sub_path, .{
|
||||
.truncate = false,
|
||||
.read = true,
|
||||
});
|
||||
self.d_sym = .{
|
||||
.base = self,
|
||||
.file = d_sym_file,
|
||||
};
|
||||
if (!options.strip and options.module != null) {
|
||||
const dir = options.module.?.zig_cache_artifact_directory;
|
||||
log.debug("creating {s}.dSYM bundle in {s}", .{ sub_path, dir.path });
|
||||
|
||||
const d_sym_path = try fmt.allocPrint(
|
||||
allocator,
|
||||
"{s}.dSYM" ++ fs.path.sep_str ++ "Contents" ++ fs.path.sep_str ++ "Resources" ++ fs.path.sep_str ++ "DWARF",
|
||||
.{sub_path},
|
||||
);
|
||||
defer allocator.free(d_sym_path);
|
||||
|
||||
var d_sym_bundle = try dir.handle.makeOpenPath(d_sym_path, .{});
|
||||
defer d_sym_bundle.close();
|
||||
|
||||
const d_sym_file = try d_sym_bundle.createFile(sub_path, .{
|
||||
.truncate = false,
|
||||
.read = true,
|
||||
});
|
||||
|
||||
self.d_sym = .{
|
||||
.base = self,
|
||||
.file = d_sym_file,
|
||||
};
|
||||
}
|
||||
|
||||
// Index 0 is always a null symbol.
|
||||
try self.locals.append(allocator, .{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user