From d0ca8bb9bcad3cd622258fc3c99d69c43b6a63ac Mon Sep 17 00:00:00 2001 From: Bruno Lopes Date: Fri, 2 Jan 2026 08:49:00 -0300 Subject: [PATCH] meson: Check for unwind.h header from macOS SDK This makes the check more robust similarly to libbacktrace header (execinfo.h) check. --- meson.build | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index ffc20944b9..ce6bf45d8c 100644 --- a/meson.build +++ b/meson.build @@ -687,11 +687,14 @@ endif conf.set('HAVE_LIBBACKTRACE', libbacktrace.found()) ## Check for libunwind +# In most platforms, unw_*() functions are in the libunwind library. +# In macOS, it is on libSystem (there we only need the SDK header). libunwind = ( get_option('libunwind') ? dependency('libunwind', version: '>=1.1.0', required: false) : no_dep ) -conf.set('HAVE_LIBUNWIND', libunwind.found()) +have_unwind = libunwind.found() or cc.has_header('unwind.h') +conf.set('HAVE_LIBUNWIND', have_unwind ? 1 : false) ## Check for backtrace() API # In musl, backtrace() is in the libexecinfo library.