Skip to content
Permalink
Browse files

Merge pull request #8135 from lioncash/cmake

CMakeLists: Specify header files in target sources
  • Loading branch information...
leoetlino committed May 31, 2019
2 parents 2cb59ab + 3d27439 commit eed4fcc218beeae5a4e87790dfba2e3179cabe20
@@ -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)
@@ -1,52 +1,131 @@
add_library(common
Analytics.cpp
Analytics.h
Assert.h
Atomic.h
BitField.h
BitSet.h
BitUtils.h
BlockingLoop.h
CDUtils.cpp
CDUtils.h
ChunkFile.h
CodeBlock.h
ColorUtil.cpp
ColorUtil.h
Common.h
CommonFuncs.cpp
CommonFuncs.h
CommonPaths.h
CommonTypes.h
Compiler.h
Config/Config.cpp
Config/Config.h
Config/ConfigInfo.cpp
Config/ConfigInfo.h
Config/Enums.h
Config/Layer.cpp
Config/Layer.h
CPUDetect.h
Crypto/AES.cpp
Crypto/AES.h
Crypto/bn.cpp
Crypto/bn.h
Crypto/ec.cpp
Crypto/ec.h
Debug/MemoryPatches.cpp
Debug/MemoryPatches.h
Debug/Watches.cpp
Debug/Watches.h
DebugInterface.h
DynamicLibrary.cpp
DynamicLibrary.h
ENetUtil.cpp
ENetUtil.h
Event.h
File.cpp
File.h
FileSearch.cpp
FileSearch.h
FileUtil.cpp
FileUtil.h
FixedSizeQueue.h
Flag.h
FloatUtils.cpp
FloatUtils.h
FPURoundMode.h
GekkoDisassembler.cpp
GekkoDisassembler.h
Hash.cpp
Hash.h
HttpRequest.cpp
HttpRequest.h
Image.cpp
Image.h
IniFile.cpp
IniFile.h
JitRegister.cpp
JitRegister.h
Lazy.h
LinearDiskCache.h
Logging/ConsoleListener.h
Logging/Log.h
Logging/LogManager.cpp
Logging/LogManager.h
MathUtil.cpp
MathUtil.h
Matrix.cpp
Matrix.h
MD5.cpp
MD5.h
MemArena.cpp
MemArena.h
MemoryUtil.cpp
MemoryUtil.h
MsgHandler.cpp
MsgHandler.h
NandPaths.cpp
NandPaths.h
Network.cpp
Network.h
PcapFile.cpp
PcapFile.h
PerformanceCounter.cpp
PerformanceCounter.h
Profiler.cpp
Profiler.h
QoSSession.cpp
QoSSession.h
Random.cpp
Random.h
Result.h
ScopeGuard.h
SDCardUtil.cpp
SDCardUtil.h
Semaphore.h
SFMLHelper.cpp
SFMLHelper.h
SettingsHandler.cpp
SettingsHandler.h
SPSCQueue.h
StringUtil.cpp
StringUtil.h
SymbolDB.cpp
SymbolDB.h
Thread.cpp
Thread.h
Timer.cpp
Timer.h
TraversalClient.cpp
TraversalClient.h
TraversalProto.h
UPnP.cpp
UPnP.h
VariantUtil.h
Version.cpp
Version.h
WindowSystemInfo.h
WorkQueueThread.h
)

target_link_libraries(common
@@ -82,11 +161,13 @@ endif()
if(ANDROID)
target_sources(common PRIVATE
AndroidAnalytics.cpp
AndroidAnalytics.h
Logging/ConsoleListenerDroid.cpp
)
elseif(WIN32)
target_sources(common PRIVATE
LdrWatcher.cpp
LdrWatcher.h
Logging/ConsoleListenerWin.cpp
)
else()
@@ -98,16 +179,21 @@ endif()
if(_M_ARM_64)
target_sources(common PRIVATE
Arm64Emitter.cpp
Arm64Emitter.h
ArmCommon.h
ArmCPUDetect.cpp
GenericFPURoundMode.cpp
)
else()
if(_M_X86) #X86
target_sources(common PRIVATE
x64ABI.cpp
x64ABI.h
x64Emitter.cpp
x64Emitter.h
x64FPURoundMode.cpp
x64CPUDetect.cpp
x64Reg.h
)
else() # Generic
target_sources(common PRIVATE
@@ -119,17 +205,29 @@ endif()

# OpenGL Interface
target_sources(common PRIVATE
GL/GLContext.cpp
GL/GLContext.h
GL/GLUtil.cpp
GL/GLUtil.h
GL/GLExtensions/GLExtensions.cpp
GL/GLContext.cpp
GL/GLExtensions/GLExtensions.h
)

if(ENABLE_EGL AND EGL_FOUND)
target_sources(common PRIVATE GL/GLInterface/EGL.cpp)
target_sources(common PRIVATE
GL/GLInterface/EGL.cpp
GL/GLInterface/EGL.h
)
if(ANDROID)
target_sources(common PRIVATE GL/GLInterface/EGLAndroid.cpp)
target_sources(common PRIVATE
GL/GLInterface/EGLAndroid.cpp
GL/GLInterface/EGLAndroid.h
)
elseif(ENABLE_X11 AND X11_FOUND)
target_sources(common PRIVATE GL/GLInterface/EGLX11.cpp)
target_sources(common PRIVATE
GL/GLInterface/EGLX11.cpp
GL/GLInterface/EGLX11.h
)
endif()
target_include_directories(common PRIVATE ${EGL_INCLUDE_DIRS})
target_link_libraries(common PUBLIC ${EGL_LIBRARIES})
@@ -139,13 +237,20 @@ if(WIN32)
target_sources(common PRIVATE
CompatPatches.cpp
GL/GLInterface/WGL.cpp
GL/GLInterface/WGL.h
)
elseif(APPLE)
target_sources(common PRIVATE GL/GLInterface/AGL.mm)
target_sources(common PRIVATE
GL/GLInterface/AGL.h
GL/GLInterface/AGL.mm
)
elseif(ENABLE_X11 AND X11_FOUND)
target_sources(common PRIVATE
GL/GLX11Window.cpp
GL/GLInterface/GLX.cpp)
GL/GLX11Window.h
GL/GLInterface/GLX.cpp
GL/GLInterface/GLX.h
)

# GLX has a hard dependency on libGL.
# Make sure to link to it if using GLX.

0 comments on commit eed4fcc

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