meson: Fix libunwind header detection on non-macOS platforms
Closes: #15750
This commit is contained in:
parent
945df2052c
commit
1aa51ca063
1 changed files with 10 additions and 7 deletions
17
meson.build
17
meson.build
|
|
@ -721,11 +721,14 @@ 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
|
||||
)
|
||||
have_unwind = libunwind.found() or cc.has_header('libunwind.h', required: false)
|
||||
libunwind = no_dep
|
||||
if get_option('libunwind')
|
||||
libunwind = dependency('libunwind', version: '>=1.1.0', required: false)
|
||||
libunwind_h = platform_osx ? cc.has_header('libunwind.h', required: false) : false
|
||||
have_unwind = libunwind.found() or libunwind_h
|
||||
else
|
||||
have_unwind = false
|
||||
endif
|
||||
conf.set('HAVE_LIBUNWIND', have_unwind ? 1 : false)
|
||||
|
||||
## Check for backtrace() API
|
||||
|
|
@ -748,11 +751,11 @@ if platform_windows
|
|||
elif platform_linux
|
||||
if not have_execinfo_h
|
||||
dashboard_backtrace='no (missing: execinfo.h)'
|
||||
elif not libbacktrace.found() and not libunwind.found()
|
||||
elif not libbacktrace.found() and not have_unwind
|
||||
dashboard_backtrace='rough (missing: libbacktrace and libunwind)'
|
||||
elif not libbacktrace.found()
|
||||
dashboard_backtrace='partially detailed (missing: libbacktrace)'
|
||||
elif not libunwind.found()
|
||||
elif not have_unwind
|
||||
dashboard_backtrace='partially detailed (missing: libunwind)'
|
||||
else
|
||||
dashboard_backtrace='detailed'
|
||||
|
|
|
|||
Loading…
Reference in a new issue