[glib/wip/pwithnall/meson-cleanups: 30/31] build: Use cc.check_header() to check malloc.h




commit 1724144940a633ca0c7533a510c00c4e6953bd5c
Author: Philip Withnall <pwithnall endlessos org>
Date:   Thu May 12 11:18:42 2022 +0100

    build: Use cc.check_header() to check malloc.h
    
    Since Meson 0.47, this can be used to check a header with compilation,
    rather than just stat. This removes a workaround.
    
    Signed-off-by: Philip Withnall <pwithnall endlessos org>

 meson.build | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/meson.build b/meson.build
index 89a405dfea..53012a9213 100644
--- a/meson.build
+++ b/meson.build
@@ -337,9 +337,9 @@ foreach h : headers
   endif
 endforeach
 
-# FIXME: Use cc.check_header from Meson 0.47.
-# FreeBSD includes a malloc.h which always throw compilation error.
-if cc.compiles('#include <malloc.h>', name : 'malloc.h')
+# FreeBSD includes a malloc.h which always throws compilation error, so we have
+# to use check_header() rather than has_header().
+if cc.check_header('malloc.h')
   glib_conf.set('HAVE_MALLOC_H', 1)
   glib_conf_prefix = glib_conf_prefix + '#define HAVE_MALLOC_H 1\n'
 endif


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]