Skip to content
Permalink
Browse files

AudioCommon/CMakeLists: Specify headers in target sources

  • Loading branch information...
lioncash committed May 29, 2019
1 parent 48b82e8 commit b6d9b8529361af79009726cb70d3e9ed42195440
Showing with 34 additions and 9 deletions.
  1. +34 −9 Source/Core/AudioCommon/CMakeLists.txt
@@ -1,26 +1,40 @@
add_library(audiocommon
AudioCommon.cpp
AudioCommon.h
AudioStretcher.cpp
AudioStretcher.h
CubebStream.cpp
CubebStream.h
CubebUtils.cpp
CubebUtils.h
Mixer.cpp
Mixer.h
SurroundDecoder.cpp
SurroundDecoder.h
NullSoundStream.cpp
NullSoundStream.h
WaveFile.cpp
WaveFile.h
)

find_package(OpenSLES)
if(OPENSLES_FOUND)
message(STATUS "OpenSLES found, enabling OpenSLES sound backend")
target_sources(audiocommon PRIVATE OpenSLESStream.cpp)
target_sources(audiocommon PRIVATE
OpenSLESStream.cpp
OpenSLESStream.h
)
target_link_libraries(audiocommon PRIVATE OpenSLES::OpenSLES)
endif()

if(ENABLE_ALSA)
find_package(ALSA)
if(ALSA_FOUND)
message(STATUS "ALSA found, enabling ALSA sound backend")
target_sources(audiocommon PRIVATE AlsaSoundStream.cpp)
target_sources(audiocommon PRIVATE
AlsaSoundStream.cpp
AlsaSoundStream.h
)
target_link_libraries(audiocommon PRIVATE ALSA::ALSA)
target_compile_definitions(audiocommon PRIVATE HAVE_ALSA=1)
else()
@@ -36,7 +50,10 @@ if(ENABLE_PULSEAUDIO)
find_package(PulseAudio MODULE QUIET)
if(PULSEAUDIO_FOUND)
message(STATUS "PulseAudio found, enabling PulseAudio sound backend")
target_sources(audiocommon PRIVATE PulseAudioStream.cpp)
target_sources(audiocommon PRIVATE
PulseAudioStream.cpp
PulseAudioStream.h
)
target_link_libraries(audiocommon PRIVATE PulseAudio::PulseAudio)
target_compile_definitions(audiocommon PRIVATE HAVE_PULSEAUDIO=1)
else()
@@ -47,18 +64,26 @@ else()
endif()

if(WIN32)
target_sources(audiocommon PRIVATE WASAPIStream.cpp)
target_sources(audiocommon PRIVATE XAudio2Stream.cpp)
target_sources(audiocommon PRIVATE
# Dolphin loads openal32.dll at runtime
OpenALStream.cpp
OpenALStream.h

WASAPIStream.cpp
WASAPIStream.h
XAudio2Stream.cpp
XAudio2Stream.h
)

add_library(audiocommon_xaudio27 "XAudio2_7Stream.cpp")
add_library(audiocommon_xaudio27
XAudio2_7Stream.cpp
XAudio2_7Stream.h
)
target_include_directories(audiocommon_xaudio27 PRIVATE
${PROJECT_SOURCE_DIR}/Externals
${PROJECT_SOURCE_DIR}/Externals/XAudio2_7
)
target_link_libraries(audiocommon PRIVATE audiocommon_xaudio27)

# Dolphin loads openal32.dll at runtime
target_sources(audiocommon PRIVATE OpenALStream.cpp)
endif()

target_link_libraries(audiocommon PRIVATE cubeb SoundTouch FreeSurround)

0 comments on commit b6d9b85

Please sign in to comment.
You can’t perform that action at this time.