[PATCH 4/7] meson: fix detection of curses with pkgconfig

Paolo Bonzini posted 7 patches 4 years, 11 months ago
[PATCH 4/7] meson: fix detection of curses with pkgconfig
Posted by Paolo Bonzini 4 years, 11 months ago
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 meson.build | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/meson.build b/meson.build
index 39fc9b7143..ab622ae8bd 100644
--- a/meson.build
+++ b/meson.build
@@ -500,16 +500,16 @@ if have_system and not get_option('curses').disabled()
     endif
   endforeach
   msg = get_option('curses').enabled() ? 'curses library not found' : ''
+  curses_compile_args = ['-DNCURSES_WIDECHAR']
   if curses.found()
-    if cc.links(curses_test, dependencies: [curses])
-      curses = declare_dependency(compile_args: '-DNCURSES_WIDECHAR', dependencies: [curses])
+    if cc.links(curses_test, args: curses_compile_args, dependencies: [curses])
+      curses = declare_dependency(compile_args: curses_compile_args, dependencies: [curses])
     else
       msg = 'curses package not usable'
       curses = not_found
     endif
   endif
   if not curses.found()
-    curses_compile_args = ['-DNCURSES_WIDECHAR']
     has_curses_h = cc.has_header('curses.h', args: curses_compile_args)
     if targetos != 'windows' and not has_curses_h
       message('Trying with /usr/include/ncursesw')
-- 
2.29.2



Re: [PATCH 4/7] meson: fix detection of curses with pkgconfig
Posted by Marc-André Lureau 4 years, 11 months ago
On Wed, Dec 16, 2020 at 8:22 PM Paolo Bonzini <pbonzini@redhat.com> wrote:

> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
>

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>

---
>  meson.build | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/meson.build b/meson.build
> index 39fc9b7143..ab622ae8bd 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -500,16 +500,16 @@ if have_system and not
> get_option('curses').disabled()
>      endif
>    endforeach
>    msg = get_option('curses').enabled() ? 'curses library not found' : ''
> +  curses_compile_args = ['-DNCURSES_WIDECHAR']
>    if curses.found()
> -    if cc.links(curses_test, dependencies: [curses])
> -      curses = declare_dependency(compile_args: '-DNCURSES_WIDECHAR',
> dependencies: [curses])
> +    if cc.links(curses_test, args: curses_compile_args, dependencies:
> [curses])
> +      curses = declare_dependency(compile_args: curses_compile_args,
> dependencies: [curses])
>      else
>        msg = 'curses package not usable'
>        curses = not_found
>      endif
>    endif
>    if not curses.found()
> -    curses_compile_args = ['-DNCURSES_WIDECHAR']
>      has_curses_h = cc.has_header('curses.h', args: curses_compile_args)
>      if targetos != 'windows' and not has_curses_h
>        message('Trying with /usr/include/ncursesw')
> --
> 2.29.2
>
>
>
>

-- 
Marc-André Lureau