mirror of https://github.com/PCSX2/pcsx2.git
CMake: Windows Qt build support
This commit is contained in:
parent
8975f2d92c
commit
4e4ffa6526
|
@ -92,22 +92,16 @@ if(TARGET SDL2::SDL2 OR TARGET SDL2::SDL2-static)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
# Resources
|
if(PCSX2_CORE)
|
||||||
target_sources(PCSX2 PRIVATE
|
set(MIN_WIN32 0x0A00)
|
||||||
PCSX2.rc
|
else()
|
||||||
GS/GS.rc
|
set(MIN_WIN32 0x0603)
|
||||||
PAD/Windows/PAD.rc
|
endif()
|
||||||
SPU2/Windows/SPU2.rc
|
|
||||||
USB/usb-pad/dx/versionproxy.rc
|
|
||||||
USB/usb-pad/raw/raw-config.rc
|
|
||||||
windows/wxResources.rc
|
|
||||||
windows/PCSX2.manifest
|
|
||||||
)
|
|
||||||
target_compile_definitions(PCSX2_FLAGS INTERFACE
|
target_compile_definitions(PCSX2_FLAGS INTERFACE
|
||||||
_M_SSE=0x401 # TODO: Multiple ISA
|
_M_SSE=0x401 # TODO: Multiple ISA
|
||||||
DIRECTINPUT_VERSION=0x0800
|
DIRECTINPUT_VERSION=0x0800
|
||||||
WINVER=0x0603
|
WINVER=${MIN_WIN32}
|
||||||
_WIN32_WINNT=0x0603
|
_WIN32_WINNT=${MIN_WIN32}
|
||||||
WIN32_LEAN_AND_MEAN
|
WIN32_LEAN_AND_MEAN
|
||||||
LZMA_API_STATIC
|
LZMA_API_STATIC
|
||||||
WIL_SUPPRESS_EXCEPTIONS
|
WIL_SUPPRESS_EXCEPTIONS
|
||||||
|
@ -115,7 +109,6 @@ if(WIN32)
|
||||||
target_include_directories(PCSX2_FLAGS INTERFACE
|
target_include_directories(PCSX2_FLAGS INTERFACE
|
||||||
../3rdparty # GL headers
|
../3rdparty # GL headers
|
||||||
)
|
)
|
||||||
set_target_properties(PCSX2 PROPERTIES WIN32_EXECUTABLE TRUE)
|
|
||||||
endif(WIN32)
|
endif(WIN32)
|
||||||
|
|
||||||
# Main pcsx2 source
|
# Main pcsx2 source
|
||||||
|
@ -808,15 +801,6 @@ set(pcsx2GSMetalShaders
|
||||||
GS/Renderers/Metal/fxaa.metal
|
GS/Renderers/Metal/fxaa.metal
|
||||||
)
|
)
|
||||||
|
|
||||||
if(NOT PCSX2_CORE)
|
|
||||||
list(APPEND pcsx2GSSources
|
|
||||||
GS/Window/GSwxDialog.cpp
|
|
||||||
)
|
|
||||||
list(APPEND pcsx2GSHeaders
|
|
||||||
GS/Window/GSwxDialog.h
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(PCSX2_CORE)
|
if(PCSX2_CORE)
|
||||||
list(APPEND pcsx2SPU2Headers
|
list(APPEND pcsx2SPU2Headers
|
||||||
SPU2/Host/Config.cpp
|
SPU2/Host/Config.cpp
|
||||||
|
@ -833,7 +817,14 @@ if(PCSX2_CORE)
|
||||||
SPU2/WavFile.cpp
|
SPU2/WavFile.cpp
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
elseif(WIN32)
|
else()
|
||||||
|
list(APPEND pcsx2GSSources
|
||||||
|
GS/Window/GSwxDialog.cpp
|
||||||
|
)
|
||||||
|
list(APPEND pcsx2GSHeaders
|
||||||
|
GS/Window/GSwxDialog.h
|
||||||
|
)
|
||||||
|
if(WIN32)
|
||||||
list(APPEND pcsx2SPU2Sources
|
list(APPEND pcsx2SPU2Sources
|
||||||
SPU2/Windows/CfgHelpers.cpp
|
SPU2/Windows/CfgHelpers.cpp
|
||||||
SPU2/Windows/Config.cpp
|
SPU2/Windows/Config.cpp
|
||||||
|
@ -841,7 +832,6 @@ elseif(WIN32)
|
||||||
SPU2/Windows/ConfigSoundTouch.cpp
|
SPU2/Windows/ConfigSoundTouch.cpp
|
||||||
SPU2/Windows/dsp.cpp
|
SPU2/Windows/dsp.cpp
|
||||||
SPU2/Windows/RealtimeDebugger.cpp
|
SPU2/Windows/RealtimeDebugger.cpp
|
||||||
SPU2/Windows/SndOut_XAudio2.cpp
|
|
||||||
SPU2/Windows/UIHelpers.cpp
|
SPU2/Windows/UIHelpers.cpp
|
||||||
)
|
)
|
||||||
list(APPEND pcsx2SPU2Headers
|
list(APPEND pcsx2SPU2Headers
|
||||||
|
@ -850,6 +840,28 @@ elseif(WIN32)
|
||||||
SPU2/Windows/resource.h
|
SPU2/Windows/resource.h
|
||||||
SPU2/Windows/WinConfig.h
|
SPU2/Windows/WinConfig.h
|
||||||
)
|
)
|
||||||
|
else()
|
||||||
|
list(APPEND pcsx2SPU2Sources
|
||||||
|
SPU2/Linux/CfgHelpers.cpp
|
||||||
|
SPU2/Linux/Config.cpp
|
||||||
|
SPU2/Linux/ConfigDebug.cpp
|
||||||
|
SPU2/Linux/ConfigSoundTouch.cpp
|
||||||
|
SPU2/Linux/Dialogs.cpp
|
||||||
|
SPU2/WavFile.cpp
|
||||||
|
SPU2/wx/wxConfig.cpp
|
||||||
|
)
|
||||||
|
list(APPEND pcsx2SPU2Headers
|
||||||
|
SPU2/Linux/Config.h
|
||||||
|
SPU2/Linux/Dialogs.h
|
||||||
|
SPU2/wx/wxConfig.h
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(WIN32)
|
||||||
|
list(APPEND pcsx2SPU2Sources
|
||||||
|
SPU2/Windows/SndOut_XAudio2.cpp
|
||||||
|
)
|
||||||
|
|
||||||
list(APPEND pcsx2DEV9Sources
|
list(APPEND pcsx2DEV9Sources
|
||||||
DEV9/Win32/pcap_io_win32.cpp
|
DEV9/Win32/pcap_io_win32.cpp
|
||||||
|
@ -911,21 +923,6 @@ elseif(WIN32)
|
||||||
GS/Renderers/DX12/GSTexture12.h
|
GS/Renderers/DX12/GSTexture12.h
|
||||||
)
|
)
|
||||||
else()
|
else()
|
||||||
list(APPEND pcsx2SPU2Sources
|
|
||||||
SPU2/Linux/CfgHelpers.cpp
|
|
||||||
SPU2/Linux/Config.cpp
|
|
||||||
SPU2/Linux/ConfigDebug.cpp
|
|
||||||
SPU2/Linux/ConfigSoundTouch.cpp
|
|
||||||
SPU2/Linux/Dialogs.cpp
|
|
||||||
SPU2/WavFile.cpp
|
|
||||||
SPU2/wx/wxConfig.cpp
|
|
||||||
)
|
|
||||||
list(APPEND pcsx2SPU2Headers
|
|
||||||
SPU2/Linux/Config.h
|
|
||||||
SPU2/Linux/Dialogs.h
|
|
||||||
SPU2/wx/wxConfig.h
|
|
||||||
)
|
|
||||||
|
|
||||||
list(APPEND pcsx2USBSources
|
list(APPEND pcsx2USBSources
|
||||||
USB/icon_buzz_24.cpp
|
USB/icon_buzz_24.cpp
|
||||||
USB/linux/config-gtk.cpp
|
USB/linux/config-gtk.cpp
|
||||||
|
@ -1117,6 +1114,16 @@ if(PCSX2_CORE)
|
||||||
discord-rpc
|
discord-rpc
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
if(WIN32)
|
||||||
|
list(APPEND pcsx2FrontendSources
|
||||||
|
Frontend/DInputSource.cpp
|
||||||
|
Frontend/XInputSource.cpp
|
||||||
|
)
|
||||||
|
list(APPEND pcsx2FrontendHeaders
|
||||||
|
Frontend/DInputSource.h
|
||||||
|
Frontend/XInputSource.h
|
||||||
|
)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# gui sources
|
# gui sources
|
||||||
|
@ -1437,10 +1444,15 @@ set(pcsx2WindowsSources
|
||||||
CDVD/Windows/IOCtlSrc.cpp
|
CDVD/Windows/IOCtlSrc.cpp
|
||||||
windows/FlatFileReaderWindows.cpp
|
windows/FlatFileReaderWindows.cpp
|
||||||
windows/Optimus.cpp
|
windows/Optimus.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
if(NOT PCSX2_CORE)
|
||||||
|
list(APPEND pcsx2WindowsSources
|
||||||
windows/WinConsolePipe.cpp
|
windows/WinConsolePipe.cpp
|
||||||
windows/WinKeyCodes.cpp
|
windows/WinKeyCodes.cpp
|
||||||
windows/WinPowerProfile.cpp
|
windows/WinPowerProfile.cpp
|
||||||
)
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
# Windows headers
|
# Windows headers
|
||||||
set(pcsx2WindowsHeaders
|
set(pcsx2WindowsHeaders
|
||||||
|
@ -1829,6 +1841,24 @@ function(setup_main_executable target)
|
||||||
get_property(PCSX2_SOURCE_DIR GLOBAL PROPERTY PCSX2_SOURCE_DIR)
|
get_property(PCSX2_SOURCE_DIR GLOBAL PROPERTY PCSX2_SOURCE_DIR)
|
||||||
get_property(PCSX2_METAL_SHADERS GLOBAL PROPERTY PCSX2_METAL_SHADERS)
|
get_property(PCSX2_METAL_SHADERS GLOBAL PROPERTY PCSX2_METAL_SHADERS)
|
||||||
|
|
||||||
|
if(WIN32)
|
||||||
|
if(NOT PCSX2_CORE)
|
||||||
|
target_sources(${target} PRIVATE
|
||||||
|
${PCSX2_SOURCE_DIR}/GS/GS.rc
|
||||||
|
${PCSX2_SOURCE_DIR}/PAD/Windows/PAD.rc
|
||||||
|
${PCSX2_SOURCE_DIR}/SPU2/Windows/SPU2.rc
|
||||||
|
${PCSX2_SOURCE_DIR}/USB/usb-pad/dx/versionproxy.rc
|
||||||
|
${PCSX2_SOURCE_DIR}/USB/usb-pad/raw/raw-config.rc
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
target_sources(${target} PRIVATE
|
||||||
|
${PCSX2_SOURCE_DIR}/PCSX2.rc
|
||||||
|
${PCSX2_SOURCE_DIR}/windows/wxResources.rc
|
||||||
|
${PCSX2_SOURCE_DIR}/windows/PCSX2.manifest
|
||||||
|
)
|
||||||
|
set_target_properties(${target} PROPERTIES WIN32_EXECUTABLE TRUE)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
if(CMAKE_GENERATOR MATCHES "Xcode")
|
if(CMAKE_GENERATOR MATCHES "Xcode")
|
||||||
# If we're generating an xcode project, you can just add the shaders to the main pcsx2 target and xcode will deal with them properly
|
# If we're generating an xcode project, you can just add the shaders to the main pcsx2 target and xcode will deal with them properly
|
||||||
|
|
|
@ -1,15 +1,23 @@
|
||||||
add_executable(updater
|
add_executable(updater
|
||||||
|
SZErrors.h
|
||||||
Updater.cpp
|
Updater.cpp
|
||||||
Updater.h
|
Updater.h
|
||||||
|
UpdaterExtractor.h
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(updater PRIVATE common fmt::fmt)
|
target_link_libraries(updater PRIVATE common fmt::fmt)
|
||||||
|
target_include_directories(updater PRIVATE .)
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
target_link_libraries(updater PRIVATE
|
target_link_libraries(updater PRIVATE
|
||||||
LZMA::LZMA
|
LZMA::LZMA
|
||||||
|
Comctl32.lib
|
||||||
)
|
)
|
||||||
target_sources(updater PRIVATE
|
target_sources(updater PRIVATE
|
||||||
Win32Update.cpp
|
Windows/WindowsUpdater.cpp
|
||||||
|
Windows/resource.h
|
||||||
|
Windows/updater.rc
|
||||||
|
Windows/updater.manifest
|
||||||
)
|
)
|
||||||
|
set_target_properties(updater PROPERTIES WIN32_EXECUTABLE TRUE)
|
||||||
endif()
|
endif()
|
||||||
|
|
Loading…
Reference in New Issue