meson.build: Fix detection of symbols

This patch changes the behavior of meson to define configuration options
*only* when the symbol checked is present. Currently, it defines all of
them in config.h whether the symbol exists or not and the code that
looks for it doesn't check the macro's value, but whether it's defined.

Signed-off-by: Mark Weiman <mark.weiman@markzz.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
Mark Weiman 2021-04-16 23:45:21 -04:00 committed by Allan McRae
parent c294b7cb4c
commit 207f0439ee

View file

@ -146,7 +146,9 @@ foreach sym : [
'tcflush',
]
have = cc.has_function(sym, args : '-D_GNU_SOURCE')
if have
conf.set10('HAVE_' + sym.to_upper(), have)
endif
endforeach
foreach member : [