1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-16 16:10:06 +02:00

[CMAKE] Portaudio: do not activate OSS on Windows (#477)

* [CMAKE] Portaudio: do not activate OSS on Windows

I had a strange error when building the local portaudio library with MinGW under msys2.
The error was caused by the file sys/soundcard.h that was found somewhere in the path, because use_pa_oss is always activated regardless the platform.
So, in my opinion it is better to not activate this option if the platform is Windows.
Afterall, it is useless in this case.

* [CMAKE] Portaudio: move also remaining OSS code
This commit is contained in:
Carlo Bramini 2020-04-02 17:04:10 +02:00 committed by GitHub
parent 50c30d9ff8
commit f60bd42e9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -22,50 +22,53 @@ if( CMAKE_SYSTEM_NAME MATCHES "Windows" )
"Use the portaudio WMME interface if available" "Use the portaudio WMME interface if available"
YES YES
) )
elseif( CMAKE_SYSTEM_NAME MATCHES "Darwin" ) else()
# Look for OSS if the user wants it
cmd_option( cmd_option(
${_OPT}use_pa_coreaudio ${_OPT}use_pa_oss
"Use the portaudio CoreAudio interface if available" "Use the OSS audio interface if available"
YES
)
elseif( CMAKE_SYSTEM_NAME MATCHES "Linux|FreeBSD" )
cmd_option(
${_OPT}use_pa_alsa
"Use the portaudio ALSA interface if available"
YES YES
) )
if( ${_OPT}use_pa_alsa ) if( ${_OPT}use_pa_oss )
find_package( ALSA ) find_path( OSS_INCLUDE NAMES sys/soundcard.h )
if( NOT ALSA_FOUND ) mark_as_advanced( FORCE OSS_INCLUDE )
set_cache_value( ${_OPT}use_pa_alsa NO )
if( OSS_INCLUDE )
set( OSS_INCLUDE_DIRS ${OSS_INCLUDE} )
endif()
find_library( OSS_LIBRARY NAMES ossaudio )
mark_as_advanced( FORCE OSS_LIBRARY )
if( OSS_LIBRARY )
set( OSS_LIBRARIES ${OSS_LIBRARY} )
endif()
if( NOT OSS_INCLUDE_DIRS )
set_cache_value( ${_OPT}use_pa_oss NO )
endif() endif()
endif() endif()
endif()
# Look for OSS if the user wants it if( CMAKE_SYSTEM_NAME MATCHES "Darwin" )
cmd_option( cmd_option(
${_OPT}use_pa_oss ${_OPT}use_pa_coreaudio
"Use the OSS audio interface if available" "Use the portaudio CoreAudio interface if available"
YES YES
) )
if( ${_OPT}use_pa_oss ) elseif( CMAKE_SYSTEM_NAME MATCHES "Linux|FreeBSD" )
find_path( OSS_INCLUDE NAMES sys/soundcard.h ) cmd_option(
mark_as_advanced( FORCE OSS_INCLUDE ) ${_OPT}use_pa_alsa
"Use the portaudio ALSA interface if available"
YES
)
if( OSS_INCLUDE ) if( ${_OPT}use_pa_alsa )
set( OSS_INCLUDE_DIRS ${OSS_INCLUDE} ) find_package( ALSA )
endif() if( NOT ALSA_FOUND )
set_cache_value( ${_OPT}use_pa_alsa NO )
find_library( OSS_LIBRARY NAMES ossaudio ) endif()
mark_as_advanced( FORCE OSS_LIBRARY ) endif()
if( OSS_LIBRARY )
set( OSS_LIBRARIES ${OSS_LIBRARY} )
endif()
if( NOT OSS_INCLUDE_DIRS )
set_cache_value( ${_OPT}use_pa_oss NO )
endif() endif()
endif() endif()