From 8275c771c8f525b7f2917d1f4ade9b5e684d0a12 Mon Sep 17 00:00:00 2001 From: xavier Date: Fri, 21 May 2021 08:57:14 +0200 Subject: [PATCH] zig cc: expose header files when linking libunwind --- src/Compilation.zig | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Compilation.zig b/src/Compilation.zig index 023a54ca8d4b969f803828f57674de9b964539e5..e20ee038c12f5834ee5c03043e70c4cec18ab6b4 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -2776,6 +2776,15 @@ pub fn addCCArgs( try argv.append("-D_LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS"); } + if (comp.bin_file.options.link_libunwind) { + const libunwind_include_path = try std.fs.path.join(arena, &[_][]const u8{ + comp.zig_lib_directory.path.?, "libunwind", "include", + }); + + try argv.append("-isystem"); + try argv.append(libunwind_include_path); + } + const llvm_triple = try @import("codegen/llvm.zig").targetTriple(arena, target); try argv.appendSlice(&[_][]const u8{ "-target", llvm_triple }); -- 2.54.0