cmake: Move AO detection to AudioCommon

This commit is contained in:
Florent Castelli
2017-02-05 05:08:30 +01:00
parent eb3c172b95
commit cbb7e4072a
3 changed files with 54 additions and 16 deletions

View File

@ -29,9 +29,18 @@ else()
message(STATUS "ALSA explicitly disabled, disabling ALSA sound backend")
endif()
if(AO_FOUND)
target_sources(audiocommon PRIVATE AOSoundStream.cpp)
target_link_libraries(audiocommon PRIVATE ${AO_LIBRARIES})
if(ENABLE_AO)
find_package(AO)
if(AO_FOUND)
message(STATUS "ao found, enabling ao sound backend")
target_sources(audiocommon PRIVATE AOSoundStream.cpp)
target_link_libraries(audiocommon PRIVATE AO::AO)
target_compile_definitions(audiocommon PRIVATE HAVE_AO=1)
else()
message(STATUS "ao NOT found, disabling ao sound backend")
endif()
else()
message(STATUS "ao explicitly disabled, disabling ao sound backend")
endif()
if(OPENAL_FOUND)