Skip to content

Commit 8032ecb

Browse files
mikdusankubkon
authored andcommitted
stage3 macos: enable -headerpad_max_install_names
This pads the install names area in final (stage3) zig executable on macos. The executable size grows by 4096 bytes, or roughly 0.002% . closes #13388
1 parent 755f50a commit 8032ecb

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

build.zig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,10 @@ fn addCmakeCfgOptionsToExe(
532532
exe: *std.build.LibExeObjStep,
533533
use_zig_libcxx: bool,
534534
) !void {
535+
if (exe.target.isDarwin()) {
536+
// useful for package maintainers
537+
exe.headerpad_max_install_names = true;
538+
}
535539
exe.addObjectFile(fs.path.join(b.allocator, &[_][]const u8{
536540
cfg.cmake_binary_dir,
537541
"zigcpp",

0 commit comments

Comments
 (0)