[babl] meson build: improve function checking



commit c9b04dc42a0279f0279af8de60a39b4df521bf19
Author: John Marshall <jtm home gmail com>
Date:   Mon Jun 11 09:40:45 2018 +0100

    meson build: improve function checking

 meson.build | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/meson.build b/meson.build
index fbca825..ab1d042 100644
--- a/meson.build
+++ b/meson.build
@@ -245,11 +245,12 @@ endforeach
 # Check functions
 # general
 check_functions = [
-  ['HAVE_GETTIMEOFDAY', 'gettimeofday'],
-  ['HAVE_SRANDOM',      'srandom'     ],
+  ['HAVE_GETTIMEOFDAY', 'gettimeofday', '<sys/time.h>'],
+  ['HAVE_RINT',         'rint'        , '<math.h>'],  
+  ['HAVE_SRANDOM',      'srandom'     , '<stdlib.h>'],
 ]
 foreach func: check_functions
-  if cc.has_function(func[1])
+  if cc.has_function(func[1], prefix: '#include ' + func[2])
     conf.set(func[0], 1, description: 
       'Define to 1 if the @0@() function is available'.format(func[1]))
   endif


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