meson: use a feature option for libunwind
Reviewed-by: Jesse Natalie <jenatali@microsoft.com> Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20409>
This commit is contained in:
26
meson.build
26
meson.build
@@ -1901,25 +1901,15 @@ if get_option('execmem')
|
|||||||
pre_args += '-DMESA_EXECMEM'
|
pre_args += '-DMESA_EXECMEM'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
_libunwind = get_option('libunwind')
|
_libunwind = get_option('libunwind') \
|
||||||
if _libunwind == 'true'
|
.require(not with_platform_android, error_message : 'Android requires the use of the backtrace library, not libunwind')
|
||||||
_libunwind = 'enabled'
|
if host_machine.system() == 'darwin'
|
||||||
warning('libunwind option "true" deprecated, please use "enabled" instead.')
|
dep_unwind = meson.get_compiler('c').find_library('System', required : _libunwind)
|
||||||
elif _libunwind == 'false'
|
|
||||||
_libunwind = 'disabled'
|
|
||||||
warning('libunwind option "false" deprecated, please use "disabled" instead.')
|
|
||||||
endif
|
|
||||||
if _libunwind != 'disabled' and not with_platform_android
|
|
||||||
if host_machine.system() == 'darwin'
|
|
||||||
dep_unwind = meson.get_compiler('c').find_library('System')
|
|
||||||
else
|
|
||||||
dep_unwind = dependency('libunwind', required : _libunwind == 'enabled')
|
|
||||||
endif
|
|
||||||
if dep_unwind.found()
|
|
||||||
pre_args += '-DHAVE_LIBUNWIND'
|
|
||||||
endif
|
|
||||||
else
|
else
|
||||||
dep_unwind = null_dep
|
dep_unwind = dependency('libunwind', required : _libunwind)
|
||||||
|
endif
|
||||||
|
if dep_unwind.found()
|
||||||
|
pre_args += '-DHAVE_LIBUNWIND'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if with_osmesa
|
if with_osmesa
|
||||||
|
@@ -340,9 +340,7 @@ option(
|
|||||||
)
|
)
|
||||||
option(
|
option(
|
||||||
'libunwind',
|
'libunwind',
|
||||||
type : 'combo',
|
type : 'feature',
|
||||||
value : 'auto',
|
|
||||||
choices : ['auto', 'true', 'false', 'enabled', 'disabled'],
|
|
||||||
description : 'Use libunwind for stack-traces'
|
description : 'Use libunwind for stack-traces'
|
||||||
)
|
)
|
||||||
option(
|
option(
|
||||||
|
Reference in New Issue
Block a user