Skip to contentSkip to conversation

meson: remove unnecessary coreaudio test program

PATCH In review Paolo Bonzini 3 participants 4 messages Nov 2, 2021 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 meson: remove unnecessary coreaudio test program

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)
---
 meson.build | 16 ----------------
 1 file changed, 16 deletions(-)
meson.build +0 -16
index 3dadb245a8..d800b9c5fb 100644
@@ -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
Signature · 1 line
2.31.1
#1 lore raw
Quoted 27 lines · Paolo Bonzini

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)
---
 meson.build | 16 ----------------
 1 file changed, 16 deletions(-)
meson.build +0 -7
index 3dadb245a8..d800b9c5fb 100644
@@ -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

meson.build coreaudio = not_found · line 947

Quoted 10 lines
meson.build +0 -9
-  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

#2 lore raw
Quoted 19 lines · Peter Maydell
Quoted 9 lines

coreaudio = dependency('appleframeworks', modules: 'CoreAudio',
required: get_option('coreaudio'))

meson.build +0 -7
-  if coreaudio.found() and not cc.links('''
-    #include <CoreAudio/CoreAudio.h>
-    int main(void)
-    {
-      return (int)AudioGetCurrentHostTime();
-    }''')
-    coreaudio = not_found

meson.build coreaudio = not_found · line 947

Quoted 10 lines
meson.build +0 -9
-  endif
-
-  if not coreaudio.found()
-    if get_option('coreaudio').enabled()
-      error('CoreAudio not found')
-    else
-      warning('CoreAudio not found, disabling')
-    endif
-  endif
  endif
Quoted 7 lines

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

Reviewed-by on v1 1/1
#3 lore raw
In reply to Paolo Bonzini
Quoted 29 lines · Paolo Bonzini

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)
---
  meson.build | 16 ----------------
  1 file changed, 16 deletions(-)
meson.build +0 -9
index 3dadb245a8..d800b9c5fb 100644
@@ -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
-

meson.build coreaudio = not_found · line 949

Quoted 10 lines
meson.build +0 -7
-  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