diff options
| author | Florent Castelli <florent.castelli@gmail.com> | 2017-02-06 00:28:11 +0100 |
|---|---|---|
| committer | Florent Castelli <florent.castelli@gmail.com> | 2017-02-07 03:42:43 +0100 |
| commit | d1eaa59a8e4961bb5be012e67881ef52ca67b4e4 (patch) | |
| tree | e2169f7a0645a5dade850f37694abba23259d35d /Source | |
| parent | 662a6e836db5ac0c097281a2c6053f04f2088a9e (diff) | |
cmake: Move detection of OpenAL to AudioCommon
Diffstat (limited to 'Source')
| -rw-r--r-- | Source/Core/AudioCommon/CMakeLists.txt | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/Source/Core/AudioCommon/CMakeLists.txt b/Source/Core/AudioCommon/CMakeLists.txt index 052ae2bf0e..cfcd4be569 100644 --- a/Source/Core/AudioCommon/CMakeLists.txt +++ b/Source/Core/AudioCommon/CMakeLists.txt @@ -43,9 +43,21 @@ else() message(STATUS "ao explicitly disabled, disabling ao sound backend") endif() -if(OPENAL_FOUND) - target_sources(audiocommon PRIVATE OpenALStream.cpp aldlist.cpp) - target_link_libraries(audiocommon PRIVATE ${OPENAL_LIBRARY} SoundTouch) +if(ENABLE_OPENAL) + if(WIN32) + set(ENV{OPENALDIR} ${PROJECT_SOURCE_DIR}/Externals/OpenAL) + endif() + find_package(OpenAL) + if(OPENAL_FOUND) + message(STATUS "OpenAL found, enabling OpenAL sound backend") + target_sources(audiocommon PRIVATE OpenALStream.cpp aldlist.cpp) + target_link_libraries(audiocommon PRIVATE OpenAL::OpenAL SoundTouch) + target_compile_definitions(audiocommon PRIVATE HAVE_OPENAL=1) + else() + message(STATUS "OpenAL NOT found, disabling OpenAL sound backend") + endif() +else() + message(STATUS "OpenAL explicitly disabled, disabling OpenAL sound backend") endif() if(PULSEAUDIO_FOUND) |
