[PATCH] meson: remove unnecessary coreaudio test program

Paolo Bonzini posted 1 patch 2 years, 6 months ago
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20211102113044.204344-2-pbonzini@redhat.com
meson.build | 16 ----------------
1 file changed, 16 deletions(-)
[PATCH] meson: remove unnecessary coreaudio test program
Posted by Paolo Bonzini 2 years, 6 months ago
AudioGetCurrentHostTime has been present forever, so the test is not
enforcing a specific version of macOS.  In fact the test was broken
since it was not linking against the coreaudio dependency; just remove it.

Fixes: 87430d5b13 ("configure, meson: move audio driver detection to Meson", 2021-10-14)
Reported-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 meson.build | 16 ----------------
 1 file changed, 16 deletions(-)

diff --git a/meson.build b/meson.build
index 3dadb245a8..d800b9c5fb 100644
--- a/meson.build
+++ b/meson.build
@@ -944,22 +944,6 @@ coreaudio = not_found
 if not get_option('coreaudio').auto() or (targetos == 'darwin' and have_system)
   coreaudio = dependency('appleframeworks', modules: 'CoreAudio',
                          required: get_option('coreaudio'))
-  if coreaudio.found() and not cc.links('''
-    #include <CoreAudio/CoreAudio.h>
-    int main(void)
-    {
-      return (int)AudioGetCurrentHostTime();
-    }''')
-    coreaudio = not_found
-  endif
-
-  if not coreaudio.found()
-    if get_option('coreaudio').enabled()
-      error('CoreAudio not found')
-    else
-      warning('CoreAudio not found, disabling')
-    endif
-  endif
 endif
 
 opengl = not_found
-- 
2.31.1


Re: [PATCH] meson: remove unnecessary coreaudio test program
Posted by Peter Maydell 2 years, 6 months ago
On Tue, 2 Nov 2021 at 11:30, Paolo Bonzini <pbonzini@redhat.com> wrote:
>
> AudioGetCurrentHostTime has been present forever, so the test is not
> enforcing a specific version of macOS.  In fact the test was broken
> since it was not linking against the coreaudio dependency; just remove it.
>
> Fixes: 87430d5b13 ("configure, meson: move audio driver detection to Meson", 2021-10-14)
> Reported-by: Peter Maydell <peter.maydell@linaro.org>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  meson.build | 16 ----------------
>  1 file changed, 16 deletions(-)
>
> diff --git a/meson.build b/meson.build
> index 3dadb245a8..d800b9c5fb 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -944,22 +944,6 @@ coreaudio = not_found
>  if not get_option('coreaudio').auto() or (targetos == 'darwin' and have_system)
>    coreaudio = dependency('appleframeworks', modules: 'CoreAudio',
>                           required: get_option('coreaudio'))
> -  if coreaudio.found() and not cc.links('''
> -    #include <CoreAudio/CoreAudio.h>
> -    int main(void)
> -    {
> -      return (int)AudioGetCurrentHostTime();
> -    }''')
> -    coreaudio = not_found
> -  endif
> -
> -  if not coreaudio.found()
> -    if get_option('coreaudio').enabled()
> -      error('CoreAudio not found')
> -    else
> -      warning('CoreAudio not found, disabling')
> -    endif
> -  endif
>  endif

Don't we still want

  if not coreaudio.found()
    if get_option('coreaudio').enabled()
      error('CoreAudio not found')
    endif
  endif

?

-- PMM

Re: [PATCH] meson: remove unnecessary coreaudio test program
Posted by Paolo Bonzini 2 years, 6 months ago
On 02/11/21 12:49, Peter Maydell wrote:
>>     coreaudio = dependency('appleframeworks', modules: 'CoreAudio',
>>                            required: get_option('coreaudio'))
>> -  if coreaudio.found() and not cc.links('''
>> -    #include <CoreAudio/CoreAudio.h>
>> -    int main(void)
>> -    {
>> -      return (int)AudioGetCurrentHostTime();
>> -    }''')
>> -    coreaudio = not_found
>> -  endif
>> -
>> -  if not coreaudio.found()
>> -    if get_option('coreaudio').enabled()
>> -      error('CoreAudio not found')
>> -    else
>> -      warning('CoreAudio not found, disabling')
>> -    endif
>> -  endif
>>   endif
> Don't we still want
> 
>    if not coreaudio.found()
>      if get_option('coreaudio').enabled()
>        error('CoreAudio not found')
>      endif
>    endif

No, the "required: get_option('coreaudio')" takes care of both forced 
enabling and forced disabling.

Paolo


Re: [PATCH] meson: remove unnecessary coreaudio test program
Posted by Thomas Huth 2 years, 6 months ago
On 02/11/2021 12.30, Paolo Bonzini wrote:
> AudioGetCurrentHostTime has been present forever, so the test is not
> enforcing a specific version of macOS.  In fact the test was broken
> since it was not linking against the coreaudio dependency; just remove it.
> 
> Fixes: 87430d5b13 ("configure, meson: move audio driver detection to Meson", 2021-10-14)
> Reported-by: Peter Maydell <peter.maydell@linaro.org>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>   meson.build | 16 ----------------
>   1 file changed, 16 deletions(-)
> 
> diff --git a/meson.build b/meson.build
> index 3dadb245a8..d800b9c5fb 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -944,22 +944,6 @@ coreaudio = not_found
>   if not get_option('coreaudio').auto() or (targetos == 'darwin' and have_system)
>     coreaudio = dependency('appleframeworks', modules: 'CoreAudio',
>                            required: get_option('coreaudio'))
> -  if coreaudio.found() and not cc.links('''
> -    #include <CoreAudio/CoreAudio.h>
> -    int main(void)
> -    {
> -      return (int)AudioGetCurrentHostTime();
> -    }''')
> -    coreaudio = not_found
> -  endif
> -
> -  if not coreaudio.found()
> -    if get_option('coreaudio').enabled()
> -      error('CoreAudio not found')
> -    else
> -      warning('CoreAudio not found, disabling')
> -    endif
> -  endif
>   endif
>   
>   opengl = not_found
> 

Reviewed-by: Thomas Huth <thuth@redhat.com>