Phonon/SteamAudio support in CMake build
@@ -251,12 +251,28 @@ if(LOVR_ENABLE_THREAD AND NOT (WIN32 OR EMSCRIPTEN))
set(LOVR_PTHREADS Threads::Threads)
endif()
-# Steam Audio
+# Steam Audio (aka Phonon)
if(LOVR_USE_STEAM_AUDIO)
if(NOT LOVR_STEAM_AUDIO_PATH)
message(FATAL_ERROR "LOVR_USE_STEAM_AUDIO requires the LOVR_STEAM_AUDIO_PATH to be set to the location of the Steam Audio folder")
endif()
+ if(CMAKE_SIZEOF_VOID_P EQUAL 4) # Note: SteamAudio distributes 32 bit libs but wiring them up is very verbose
+ message(FATAL_ERROR "LOVR_USE_STEAM_AUDIO is not currently available on 32 bit builds")
+ endif()
include_directories("${LOVR_STEAM_AUDIO_PATH}/include")
+ add_library(Phonon SHARED IMPORTED)
+ if(ANDROID)
+ set_target_properties(OculusAudio PROPERTIES IMPORTED_LOCATION "${LOVR_STEAM_AUDIO_PATH}/lib/Android/arm64/libphonon.so")
+ elseif(WIN32)
+ set_target_properties(Phonon PROPERTIES IMPORTED_IMPLIB "${LOVR_STEAM_AUDIO_PATH}/lib/Windows/x64/phonon.lib")
+ set_target_properties(Phonon PROPERTIES IMPORTED_LOCATION "${LOVR_STEAM_AUDIO_PATH}/bin/Windows/x64/phonon.dll")
+ elseif(APPLE) # This should be possible, there is a dylib in OSX/
+ message(FATAL_ERROR "LOVR_USE_STEAM_AUDIO is not currently supported on Apple platforms")
+ else() # Assume Linux. Note: This has *not* been tested. FIXME: When is the .so copied?
+ set_target_properties(Phonon PROPERTIES IMPORTED_LOCATION "${LOVR_STEAM_AUDIO_PATH}/lib/Linux/x64/libphonon.so")
+ endif()
+
+ set(LOVR_PHONON Phonon)
endif()
# Oculus Audio
@@ -585,6 +601,7 @@ if(WIN32)
move_dll(${LOVR_OPENVR})
move_dll(${LOVR_MSDF})
move_dll(${LOVR_OCULUS_AUDIO})
+ move_dll(${LOVR_PHONON})
foreach(target ${ALL_PLUGIN_TARGETS})
move_dll(${target})
endforeach()
@@ -610,6 +627,7 @@ elseif(APPLE)
move_lib(${LOVR_OPENVR})
move_lib(${LOVR_MSDF})
move_lib(${LOVR_OCULUS_AUDIO})
+ move_lib(${LOVR_PHONON})
foreach(target ${ALL_PLUGIN_TARGETS})
move_lib(${target})
endforeach()
@@ -686,6 +704,11 @@ elseif(ANDROID)
file(COPY ${OCULUS_AUDIO_LIB} DESTINATION raw/lib/${ANDROID_ABI})
endif()
+ if(LOVR_USE_STEAM_AUDIO)
+ get_target_property(PHONON_LIB ${LOVR_PHONON} IMPORTED_LOCATION)
+ file(COPY ${PHONON_LIB} DESTINATION raw/lib/${ANDROID_ABI})
+ endif()
+
set(ANDROID_MANIFEST "${CMAKE_CURRENT_SOURCE_DIR}/src/resources/AndroidManifest_${MANIFEST}.xml" CACHE STRING "The AndroidManifest.xml file to use")
if(ANDROID_KEYSTORE_PASS) # Trick so that --ks-pass is not passed if no password is given.
