diff --git a/meson.build b/meson.build index 5ad2024c1..a1e98ab71 100644 --- a/meson.build +++ b/meson.build @@ -380,12 +380,6 @@ if compiler.has_header('execinfo.h') conf_data.set('HAVE_EXECINFO_H', 1) endif -if conf_data.get('CONFIG_BACKTRACE') and conf_data.get('HAVE_EXECINFO_H') - execinfodeps = compiler.find_library('execinfo', static: st, required: false) - if execinfodeps.found() - deps += execinfodeps - endif -endif if conf_data.get('CONFIG_OS_WIN32') and compiler.has_header('windows.h') conf_data.set('HAVE_WINDOWS_H', 1) @@ -401,6 +395,13 @@ endif st = get_option('static') +if conf_data.get('CONFIG_BACKTRACE') and conf_data.get('HAVE_EXECINFO_H') == 1 + execinfodeps = compiler.find_library('execinfo', static: st, required: false) + if execinfodeps.found() + deps += execinfodeps + endif +endif + deps = [] if conf_data.get('CONFIG_GZIP') zdeps = dependency('zlib', static: st, required: false)