From ee8a21f1d0a0a0e63e996ae1f8e1aa03513dc22a Mon Sep 17 00:00:00 2001 From: Florent Castelli Date: Sun, 5 Feb 2017 00:33:53 +0100 Subject: [PATCH] cmake: In AudioCommon, append sources and dependencies to a real target --- Source/Core/AudioCommon/CMakeLists.txt | 29 +++++++++++++------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/Source/Core/AudioCommon/CMakeLists.txt b/Source/Core/AudioCommon/CMakeLists.txt index 0d4521af4e..51617eede9 100644 --- a/Source/Core/AudioCommon/CMakeLists.txt +++ b/Source/Core/AudioCommon/CMakeLists.txt @@ -6,48 +6,47 @@ set(SRCS NullSoundStream.cpp ) -set(LIBS "") +add_dolphin_library(audiocommon "${SRCS}" "") find_package(OpenSLES) if(OPENSLES_FOUND) message(STATUS "OpenSLES found, enabling OpenSLES sound backend") - set(SRCS ${SRCS} OpenSLESStream.cpp) - set(LIBS ${LIBS} OpenSLES::OpenSLES) + target_sources(audiocommon PRIVATE OpenSLESStream.cpp) + target_link_libraries(audiocommon PRIVATE OpenSLES::OpenSLES) endif() if(ALSA_FOUND) - set(SRCS ${SRCS} AlsaSoundStream.cpp) - set(LIBS ${LIBS} ${ALSA_LIBRARIES}) + target_sources(audiocommon PRIVATE AlsaSoundStream.cpp) + target_link_libraries(audiocommon PRIVATE ${ALSA_LIBRARIES}) endif() if(AO_FOUND) - set(SRCS ${SRCS} AOSoundStream.cpp) - set(LIBS ${LIBS} ${AO_LIBRARIES}) + target_sources(audiocommon PRIVATE AOSoundStream.cpp) + target_link_libraries(audiocommon PRIVATE ${AO_LIBRARIES}) endif() if(OPENAL_FOUND) - set(SRCS ${SRCS} OpenALStream.cpp aldlist.cpp) - set(LIBS ${LIBS} ${OPENAL_LIBRARY} SoundTouch ) + target_sources(audiocommon PRIVATE OpenALStream.cpp aldlist.cpp) + target_link_libraries(audiocommon PRIVATE ${OPENAL_LIBRARY} SoundTouch) endif() if(PULSEAUDIO_FOUND) - set(SRCS ${SRCS} PulseAudioStream.cpp) - set(LIBS ${LIBS} ${PULSEAUDIO_LIBRARIES}) + target_sources(audiocommon PRIVATE PulseAudioStream.cpp) + target_link_libraries(audiocommon PRIVATE ${PULSEAUDIO_LIBRARIES}) endif() if(WIN32) - set(SRCS ${SRCS} XAudio2Stream.cpp) + target_sources(audiocommon PRIVATE XAudio2Stream.cpp) add_dolphin_library(audiocommon_xaudio27 "XAudio2_7Stream.cpp" "${LIBS}") target_include_directories(audiocommon_xaudio27 PRIVATE ${PROJECT_SOURCE_DIR}/Externals ${PROJECT_SOURCE_DIR}/Externals/XAudio2_7 ) - list(APPEND LIBS audiocommon_xaudio27) + target_link_libraries(audiocommon PRIVATE audiocommon_xaudio27) elseif(APPLE) - set(SRCS ${SRCS} CoreAudioSoundStream.cpp) + target_sources(audiocommon PRIVATE CoreAudioSoundStream.cpp) endif() -add_dolphin_library(audiocommon "${SRCS}" "${LIBS}")