2023-09-05 00:16:30 +00:00
|
|
|
# windows specific compile definitions
|
|
|
|
|
|
|
|
add_compile_definitions(SUNSHINE_PLATFORM="windows")
|
|
|
|
|
|
|
|
enable_language(RC)
|
|
|
|
set(CMAKE_RC_COMPILER windres)
|
|
|
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static")
|
|
|
|
|
2024-02-25 03:34:53 +00:00
|
|
|
# gcc complains about misleading indentation in some mingw includes
|
|
|
|
list(APPEND SUNSHINE_COMPILE_OPTIONS -Wno-misleading-indentation)
|
|
|
|
|
2024-05-27 18:16:14 +00:00
|
|
|
# see gcc bug 98723
|
|
|
|
add_definitions(-DUSE_BOOST_REGEX)
|
|
|
|
|
2023-09-05 00:16:30 +00:00
|
|
|
# curl
|
|
|
|
add_definitions(-DCURL_STATICLIB)
|
|
|
|
include_directories(SYSTEM ${CURL_STATIC_INCLUDE_DIRS})
|
|
|
|
link_directories(${CURL_STATIC_LIBRARY_DIRS})
|
|
|
|
|
2024-01-01 23:48:27 +00:00
|
|
|
# miniupnpc
|
|
|
|
add_definitions(-DMINIUPNP_STATICLIB)
|
|
|
|
|
2023-09-05 00:16:30 +00:00
|
|
|
# extra tools/binaries for audio/display devices
|
|
|
|
add_subdirectory(tools) # todo - this is temporary, only tools for Windows are needed, for now
|
|
|
|
|
|
|
|
# nvidia
|
2024-02-03 20:29:09 +00:00
|
|
|
include_directories(SYSTEM "${CMAKE_SOURCE_DIR}/third-party/nvapi-open-source-sdk")
|
2023-09-05 00:16:30 +00:00
|
|
|
file(GLOB NVPREFS_FILES CONFIGURE_DEPENDS
|
2024-02-03 20:29:09 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/third-party/nvapi-open-source-sdk/*.h"
|
|
|
|
"${CMAKE_SOURCE_DIR}/src/platform/windows/nvprefs/*.cpp"
|
|
|
|
"${CMAKE_SOURCE_DIR}/src/platform/windows/nvprefs/*.h")
|
2023-09-05 00:16:30 +00:00
|
|
|
|
|
|
|
# vigem
|
2024-02-03 20:29:09 +00:00
|
|
|
include_directories(SYSTEM "${CMAKE_SOURCE_DIR}/third-party/ViGEmClient/include")
|
2023-09-05 00:16:30 +00:00
|
|
|
|
|
|
|
# sunshine icon
|
|
|
|
if(NOT DEFINED SUNSHINE_ICON_PATH)
|
2024-02-03 20:29:09 +00:00
|
|
|
set(SUNSHINE_ICON_PATH "${CMAKE_SOURCE_DIR}/sunshine.ico")
|
2023-09-05 00:16:30 +00:00
|
|
|
endif()
|
|
|
|
|
2024-02-03 20:29:09 +00:00
|
|
|
configure_file("${CMAKE_SOURCE_DIR}/src/platform/windows/windows.rs.in" windows.rc @ONLY)
|
2023-09-05 00:16:30 +00:00
|
|
|
|
|
|
|
set(PLATFORM_TARGET_FILES
|
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}/windows.rc"
|
2024-02-03 20:29:09 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/src/platform/windows/publish.cpp"
|
|
|
|
"${CMAKE_SOURCE_DIR}/src/platform/windows/misc.h"
|
|
|
|
"${CMAKE_SOURCE_DIR}/src/platform/windows/misc.cpp"
|
|
|
|
"${CMAKE_SOURCE_DIR}/src/platform/windows/input.cpp"
|
|
|
|
"${CMAKE_SOURCE_DIR}/src/platform/windows/display.h"
|
|
|
|
"${CMAKE_SOURCE_DIR}/src/platform/windows/display_base.cpp"
|
|
|
|
"${CMAKE_SOURCE_DIR}/src/platform/windows/display_vram.cpp"
|
|
|
|
"${CMAKE_SOURCE_DIR}/src/platform/windows/display_ram.cpp"
|
2024-05-27 18:16:14 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/src/platform/windows/display_wgc.cpp"
|
2024-02-03 20:29:09 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/src/platform/windows/audio.cpp"
|
|
|
|
"${CMAKE_SOURCE_DIR}/third-party/ViGEmClient/src/ViGEmClient.cpp"
|
|
|
|
"${CMAKE_SOURCE_DIR}/third-party/ViGEmClient/include/ViGEm/Client.h"
|
|
|
|
"${CMAKE_SOURCE_DIR}/third-party/ViGEmClient/include/ViGEm/Common.h"
|
|
|
|
"${CMAKE_SOURCE_DIR}/third-party/ViGEmClient/include/ViGEm/Util.h"
|
|
|
|
"${CMAKE_SOURCE_DIR}/third-party/ViGEmClient/include/ViGEm/km/BusShared.h"
|
2023-09-05 00:16:30 +00:00
|
|
|
${NVPREFS_FILES})
|
|
|
|
|
|
|
|
set(OPENSSL_LIBRARIES
|
|
|
|
libssl.a
|
|
|
|
libcrypto.a)
|
|
|
|
|
|
|
|
list(PREPEND PLATFORM_LIBRARIES
|
|
|
|
libstdc++.a
|
|
|
|
libwinpthread.a
|
|
|
|
libssp.a
|
2024-07-11 00:03:16 +00:00
|
|
|
ntdll
|
2023-09-05 00:16:30 +00:00
|
|
|
ksuser
|
|
|
|
wsock32
|
|
|
|
ws2_32
|
|
|
|
d3d11 dxgi D3DCompiler
|
|
|
|
setupapi
|
|
|
|
dwmapi
|
|
|
|
userenv
|
|
|
|
synchronization.lib
|
|
|
|
avrt
|
2024-01-01 23:48:27 +00:00
|
|
|
iphlpapi
|
2024-02-05 03:02:34 +00:00
|
|
|
shlwapi
|
2024-02-26 23:53:56 +00:00
|
|
|
PkgConfig::NLOHMANN_JSON
|
2023-09-05 00:16:30 +00:00
|
|
|
${CURL_STATIC_LIBRARIES})
|
|
|
|
|
|
|
|
if(SUNSHINE_ENABLE_TRAY)
|
|
|
|
list(APPEND PLATFORM_TARGET_FILES
|
2024-05-14 01:59:25 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/third-party/tray/src/tray_windows.c")
|
2023-09-05 00:16:30 +00:00
|
|
|
endif()
|