From b327e0ff2f583eb8ef7658d2deebdb03329c179a Mon Sep 17 00:00:00 2001 From: Jehan Date: Sat, 21 Sep 2019 12:36:48 +0200 Subject: [PATCH] meson: fix several checks. For pango and libbacktrace, we only need a compilation/link test. No run is needed. As for the exchndl (Windows only), this is an optional feature, hence should not be a fatale check. --- meson.build | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/meson.build b/meson.build index af02771a29..8c294acfc6 100644 --- a/meson.build +++ b/meson.build @@ -406,15 +406,13 @@ endif ################################################################################ # Check if Pango is built with a recent fontconfig -pango_check_run = cc.run( +pango_check = cc.links( '''#include int main() { FcObjectSet *os; os = FcObjectSetBuild (FC_FAMILY, FC_WIDTH); }''', dependencies: fontconfig, ) -pango_check =(pango_check_run.compiled() - and pango_check_run.returncode() == 0) if not pango_check pango_warning = '\n *** '.join([ @@ -470,7 +468,7 @@ if get_option('libbacktrace') libbacktrace = cc.find_library('backtrace', required: false) if libbacktrace.found() - libbacktrace_run = cc.run(''' + libbacktrace_links = cc.links(''' #include #include #include @@ -487,7 +485,7 @@ if get_option('libbacktrace') dependencies: libbacktrace, ) - if not(libbacktrace_run.compiled() and libbacktrace_run.returncode() == 0) + if not libbacktrace_links warning( 'libbacktrace was found, but the test compilation failed.\n' + 'You can find more info in meson-logs/meson-logs.txt.' @@ -512,7 +510,7 @@ conf.set('HAVE_LIBUNWIND', libunwind.found()) ## Check for Dr. Mingw drmingw = no_dep if platform_windows - exchndl = cc.find_library('exchndl') + exchndl = cc.find_library('exchndl', required: false) exchndl_fn = cc.has_function('ExcHndlSetLogFileNameA', dependencies: exchndl) if exchndl.found() and exchndl_fn drmingw = declare_dependency(dependencies: exchndl)