Skip to content

Commit

Permalink
meson: make backtrace dependency on execinfo
Browse files Browse the repository at this point in the history
musl libc for example has no such header.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
  • Loading branch information
neheb authored and terrelln committed Dec 14, 2022
1 parent 72845eb commit 031de3c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build/meson/meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ option('legacy_level', type: 'integer', min: 0, max: 7, value: 5,
description: 'Support any legacy format: 7 to 1 for v0.7+ to v0.1+')
option('debug_level', type: 'integer', min: 0, max: 9, value: 1,
description: 'Enable run-time debug. See lib/common/debug.h')
option('backtrace', type: 'boolean', value: false,
option('backtrace', type: 'feature', value: 'disabled',
description: 'Display a stack backtrace when execution generates a runtime exception')
option('static_runtime', type: 'boolean', value: false,
description: 'Link to static run-time libraries on MSVC')
Expand Down
3 changes: 2 additions & 1 deletion build/meson/programs/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ endif

export_dynamic_on_windows = false
# explicit backtrace enable/disable for Linux & Darwin
if not use_backtrace
execinfo = cc.has_header('execinfo.h', required: use_backtrace)
if not execinfo.found()
zstd_c_args += '-DBACKTRACE_ENABLE=0'
elif use_debug and host_machine_os == os_windows # MinGW target
zstd_c_args += '-DBACKTRACE_ENABLE=1'
Expand Down

0 comments on commit 031de3c

Please sign in to comment.