build: make libunwind optional

This commit is contained in:
Christian Hergert
2020-02-17 12:02:44 -08:00
parent ee5c43f107
commit e06638d665
3 changed files with 12 additions and 4 deletions

View File

@ -89,9 +89,11 @@ if cc.has_header('execinfo.h')
config_h.set10('HAVE_EXECINFO_H', true)
endif
libunwind_dep = dependency('libunwind-generic', required: false)
if libunwind_dep.found()
config_h.set10('ENABLE_LIBUNWIND', libunwind_dep.found())
if get_option('libunwind')
libunwind_dep = dependency('libunwind-generic', required: false)
if libunwind_dep.found()
config_h.set10('ENABLE_LIBUNWIND', libunwind_dep.found())
endif
endif
# Development build setup