From 38c568775e19dd99d72d5564752ad27781a9a102 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Wed, 19 Jan 2022 11:12:43 -0800 Subject: [PATCH] meson: use cc.has_function_attribute instead of open coding It's less code, and also allows meson to short circuit for compilers is knows don't support this. Signed-off-by: Dylan Baker Reviewed-by: Simon Ser --- meson.build | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/meson.build b/meson.build index 83bf29c3..e59fce5a 100644 --- a/meson.build +++ b/meson.build @@ -23,7 +23,7 @@ project( ['c'], version : '2.4.109', license : 'MIT', - meson_version : '>= 0.48', + meson_version : '>= 0.52', default_options : ['buildtype=debugoptimized', 'c_std=c99'], ) @@ -257,9 +257,7 @@ with_man_pages = get_option('man-pages') prog_rst2man = find_program('rst2man', 'rst2man.py', required: with_man_pages == 'true') with_man_pages = with_man_pages != 'false' and prog_rst2man.found() -config.set10('HAVE_VISIBILITY', - cc.compiles('''int foo_hidden(void) __attribute__((visibility(("hidden"))));''', - name : 'compiler supports __attribute__(("hidden"))')) +config.set10('HAVE_VISIBILITY', cc.has_function_attribute('visibility:hidden')) foreach t : [ [with_exynos, 'EXYNOS'],