build: make the xcframework step dsym aware, even though we don't use it

This was in pursuit of trying to get line numbers in `zig build run` on
macOS to work, but I wasn't able to figure that out and this wasn't the
right path because static libs can't have dsyms. But, it may still be
useful to make the xcframework step dsym aware for future use so I'm
PRing this.
This commit is contained in:
Mitchell Hashimoto
2025-07-09 21:05:54 -07:00
parent 464dc78172
commit cc0d7acaef
3 changed files with 52 additions and 7 deletions

View File

@@ -26,6 +26,9 @@ pub const Library = struct {
/// Path to a directory with the headers.
headers: LazyPath,
/// Path to a debug symbols file (.dSYM) if available.
dsym: ?LazyPath,
};
step: *Step,
@@ -52,6 +55,10 @@ pub fn create(b: *std.Build, opts: Options) *XCFrameworkStep {
run.addFileArg(lib.library);
run.addArg("-headers");
run.addFileArg(lib.headers);
if (lib.dsym) |dsym| {
run.addArg("-debug-symbols");
run.addFileArg(dsym);
}
}
run.addArg("-output");
run.addArg(opts.out_path);