Skip to content

Commit

Permalink
Merge pull request #4696 from Orphis/cmake_cleanup
Browse files Browse the repository at this point in the history
CMake cleanup for Windows (moar!)
  • Loading branch information
Parlane committed Jan 21, 2017
2 parents a945b4e + b6a7216 commit 71ea457
Show file tree
Hide file tree
Showing 9 changed files with 145 additions and 4 deletions.
6 changes: 5 additions & 1 deletion CMakeLists.txt
Expand Up @@ -450,7 +450,7 @@ if(ANDROID)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
SET(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
elseif(NOT APPLE AND NOT CMAKE_SYSTEM_NAME MATCHES OpenBSD)
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
list(APPEND LIBS rt)
endif()

Expand Down Expand Up @@ -898,6 +898,10 @@ if(NOT ANDROID)
message(STATUS "Using static hidapi-hidraw from Externals")
add_subdirectory(Externals/hidapi/linux)
list(APPEND LIBS hidapi-hidraw udev)
elseif(MSVC)
message(STATUS "Using static hidapi-hid from Externals")
add_subdirectory(Externals/hidapi/windows)
list(APPEND LIBS hidapi-hid)
else()
message(STATUS "Using static hidapi-libusb from Externals")
add_subdirectory(Externals/hidapi/libusb)
Expand Down
1 change: 1 addition & 0 deletions Externals/hidapi/windows/CMakeLists.txt
@@ -0,0 +1 @@
add_library(hidapi-hid hid.c)
9 changes: 9 additions & 0 deletions Source/Core/AudioCommon/CMakeLists.txt
Expand Up @@ -33,8 +33,17 @@ endif(PULSEAUDIO_FOUND)

if(WIN32)
set(SRCS ${SRCS} 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)

elseif(APPLE)
set(SRCS ${SRCS} CoreAudioSoundStream.cpp)
endif()


add_dolphin_library(audiocommon "${SRCS}" "${LIBS}")
9 changes: 8 additions & 1 deletion Source/Core/Common/CMakeLists.txt
Expand Up @@ -37,6 +37,9 @@ set(SRCS Analytics.cpp
if(ANDROID)
set(SRCS ${SRCS}
Logging/ConsoleListenerDroid.cpp)
elseif(WIN32)
set(SRCS ${SRCS}
Logging/ConsoleListenerWin.cpp)
else()
set(SRCS ${SRCS}
Logging/ConsoleListenerNix.cpp)
Expand Down Expand Up @@ -98,4 +101,8 @@ if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
endif()

add_dolphin_library(common "${SRCS}" "${LIBS}")
add_executable(traversal_server TraversalServer.cpp)

if(UNIX)
# Posix networking code needs to be fixed for Windows
add_executable(traversal_server TraversalServer.cpp)
endif()
6 changes: 6 additions & 0 deletions Source/Core/Core/CMakeLists.txt
Expand Up @@ -274,6 +274,12 @@ set(LIBS ${LIBS} ${MBEDTLS_LIBRARIES})

if(WIN32)
set(SRCS ${SRCS} HW/EXI/BBA-TAP/TAP_Win32.cpp HW/WiimoteReal/IOWin.cpp)
list(APPEND LIBS
videod3d
videod3d12
setupapi.lib
iphlpapi.lib
)
elseif(APPLE)
set(SRCS ${SRCS} HW/EXI/BBA-TAP/TAP_Apple.cpp HW/WiimoteReal/IOdarwin.mm)
set(LIBS ${LIBS}
Expand Down
4 changes: 4 additions & 0 deletions Source/Core/DolphinWX/CMakeLists.txt
Expand Up @@ -212,6 +212,10 @@ if(wxWidgets_FOUND)
install(DIRECTORY ${BUNDLE_PATH} DESTINATION /Applications
USE_SOURCE_PERMISSIONS
)
elseif(WIN32)
set_target_properties(${DOLPHIN_EXE} PROPERTIES
WIN32_EXECUTABLE ON
)
else()
install(TARGETS ${DOLPHIN_EXE} RUNTIME DESTINATION ${bindir})
endif()
Expand Down
9 changes: 7 additions & 2 deletions Source/Core/VideoBackends/CMakeLists.txt
@@ -1,7 +1,12 @@
add_subdirectory(OGL)
add_subdirectory(Null)
add_subdirectory(Software)

if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
add_subdirectory(D3D)
add_subdirectory(D3D12)
endif()

if(NOT APPLE)
add_subdirectory(Vulkan)
add_subdirectory(Vulkan)
endif()
# TODO: Add other backends here!
50 changes: 50 additions & 0 deletions Source/Core/VideoBackends/D3D/CMakeLists.txt
@@ -0,0 +1,50 @@
set(SRCS
BoundingBox.cpp
BoundingBox.h
D3DBase.cpp
D3DBase.h
D3DBlob.cpp
D3DBlob.h
D3DShader.cpp
D3DShader.h
D3DState.cpp
D3DState.h
D3DTexture.cpp
D3DTexture.h
D3DUtil.cpp
D3DUtil.h
FramebufferManager.cpp
FramebufferManager.h
GeometryShaderCache.cpp
GeometryShaderCache.h
main.cpp
NativeVertexFormat.cpp
PerfQuery.cpp
PerfQuery.h
PixelShaderCache.cpp
PixelShaderCache.h
PSTextureEncoder.cpp
PSTextureEncoder.h
Render.cpp
Render.h
Television.cpp
Television.h
TextureCache.cpp
TextureCache.h
TextureEncoder.h
VertexManager.cpp
VertexManager.h
VertexShaderCache.cpp
VertexShaderCache.h
VideoBackend.h
XFBEncoder.cpp
XFBEncoder.h
)

set(LIBS
videocommon
SOIL
common
)

add_dolphin_library(videod3d "${SRCS}" "${LIBS}")
55 changes: 55 additions & 0 deletions Source/Core/VideoBackends/D3D12/CMakeLists.txt
@@ -0,0 +1,55 @@
set(SRCS
BoundingBox.cpp
BoundingBox.h
D3DBase.cpp
D3DBase.h
D3DCommandListManager.cpp
D3DCommandListManager.h
D3DDescriptorHeapManager.cpp
D3DDescriptorHeapManager.h
D3DQueuedCommandList.cpp
D3DQueuedCommandList.h
D3DShader.cpp
D3DShader.h
D3DState.cpp
D3DState.h
D3DStreamBuffer.cpp
D3DStreamBuffer.h
D3DTexture.cpp
D3DTexture.h
D3DUtil.cpp
D3DUtil.h
FramebufferManager.cpp
FramebufferManager.h
main.cpp
NativeVertexFormat.cpp
NativeVertexFormat.h
PerfQuery.cpp
PerfQuery.h
PSTextureEncoder.cpp
PSTextureEncoder.h
Render.cpp
Render.h
ShaderCache.cpp
ShaderCache.h
ShaderConstantsManager.cpp
ShaderConstantsManager.h
StaticShaderCache.cpp
StaticShaderCache.h
TextureCache.cpp
TextureCache.h
TextureEncoder.h
VertexManager.cpp
VertexManager.h
VideoBackend.h
XFBEncoder.cpp
XFBEncoder.h
)

set(LIBS
videocommon
SOIL
common
)

add_dolphin_library(videod3d12 "${SRCS}" "${LIBS}")

0 comments on commit 71ea457

Please sign in to comment.