Skip to content

Commit 8275c77

Browse files
xxxbxxxandrewrk
authored andcommitted
zig cc: expose header files when linking libunwind
1 parent 1df9937 commit 8275c77

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/Compilation.zig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2776,6 +2776,15 @@ pub fn addCCArgs(
27762776
try argv.append("-D_LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS");
27772777
}
27782778

2779+
if (comp.bin_file.options.link_libunwind) {
2780+
const libunwind_include_path = try std.fs.path.join(arena, &[_][]const u8{
2781+
comp.zig_lib_directory.path.?, "libunwind", "include",
2782+
});
2783+
2784+
try argv.append("-isystem");
2785+
try argv.append(libunwind_include_path);
2786+
}
2787+
27792788
const llvm_triple = try @import("codegen/llvm.zig").targetTriple(arena, target);
27802789
try argv.appendSlice(&[_][]const u8{ "-target", llvm_triple });
27812790

0 commit comments

Comments
 (0)