Build environment: require Alsa/OSS/PulseAudio backends for OpenAL on Linux.
authorBrecht Van Lommel <brechtvanlommel@gmail.com>
Wed, 13 Mar 2019 12:00:03 +0000 (13:00 +0100)
committerBrecht Van Lommel <brechtvanlommel@gmail.com>
Wed, 13 Mar 2019 12:00:03 +0000 (13:00 +0100)
Otherwise we can silently build an OpenAL that can't actually playback audio.

build_files/build_environment/cmake/openal.cmake

index 3cd3a0a..7a693b1 100644 (file)
 
 if(BUILD_MODE STREQUAL Release)
        set(OPENAL_EXTRA_ARGS
 
 if(BUILD_MODE STREQUAL Release)
        set(OPENAL_EXTRA_ARGS
-               -DALSOFT_UTILS=Off
-               -DALSOFT_NO_CONFIG_UTIL=On
-               -DALSOFT_EXAMPLES=Off
-               -DALSOFT_TESTS=Off
-               -DALSOFT_CONFIG=Off
-               -DALSOFT_HRTF_DEFS=Off
-               -DALSOFT_INSTALL=On
-               -DALSOFT_BACKEND_SNDIO=Off
+               -DALSOFT_UTILS=OFF
+               -DALSOFT_NO_CONFIG_UTIL=ON
+               -DALSOFT_EXAMPLES=OFF
+               -DALSOFT_TESTS=OFF
+               -DALSOFT_CONFIG=OFF
+               -DALSOFT_HRTF_DEFS=OFF
+               -DALSOFT_INSTALL=ON
+               -DALSOFT_BACKEND_SNDIO=OFF
        )
 
        if(UNIX)
        )
 
        if(UNIX)
-               set(OPENAL_EXTRA_ARGS ${OPENAL_EXTRA_ARGS} -DLIBTYPE=STATIC)
+               set(OPENAL_EXTRA_ARGS
+                       ${OPENAL_EXTRA_ARGS}
+                       -DLIBTYPE=STATIC
+               )
+       endif()
+
+       if(UNIX AND NOT APPLE)
+               # Ensure we have backends for playback.
+               set(OPENAL_EXTRA_ARGS
+                       ${OPENAL_EXTRA_ARGS}
+                       -DALSOFT_REQUIRE_ALSA=ON
+                       -DALSOFT_REQUIRE_OSS=ON
+                       -DALSOFT_REQUIRE_PULSEAUDIO=ON
+               )
        endif()
 
        ExternalProject_Add(external_openal
        endif()
 
        ExternalProject_Add(external_openal