Skip to content

Commit

Permalink
refactor: move server files, split input types
Browse files Browse the repository at this point in the history
chore: fix weird imports

chore: fix sys tray import error

chore: fix clang code style

refactor: mouse, keyboard and touch now on their own namespaces

fix: make platf_input a singleton

refactor: better isolation

lint: remove import and space

lint: import order

docs: refactor docs too

lint: new line at the end

build: glob linking input/server

build: full src glob

chore: rebase fixes

chore: revert doc changes

docs(src): apply new patterns from #2763

chore: fixes from code review
  • Loading branch information
Hazer committed Aug 11, 2024
1 parent f9c885a commit cadeff3
Show file tree
Hide file tree
Showing 53 changed files with 2,455 additions and 1,937 deletions.
59 changes: 5 additions & 54 deletions cmake/compile_definitions/common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -55,66 +55,17 @@ list(APPEND PLATFORM_TARGET_FILES ${NVENC_SOURCES})
configure_file("${CMAKE_SOURCE_DIR}/src/version.h.in" version.h @ONLY)
include_directories("${CMAKE_CURRENT_BINARY_DIR}") # required for importing version.h

file(GLOB_RECURSE COMMON_SOURCES
${CMAKE_SOURCE_DIR}/src/**)
list(FILTER COMMON_SOURCES EXCLUDE REGEX "${CMAKE_SOURCE_DIR}/src/platform/.*")

set(SUNSHINE_TARGET_FILES
"${CMAKE_SOURCE_DIR}/third-party/moonlight-common-c/src/Input.h"
"${CMAKE_SOURCE_DIR}/third-party/moonlight-common-c/src/Rtsp.h"
"${CMAKE_SOURCE_DIR}/third-party/moonlight-common-c/src/RtspParser.c"
"${CMAKE_SOURCE_DIR}/third-party/moonlight-common-c/src/Video.h"
"${CMAKE_SOURCE_DIR}/third-party/tray/src/tray.h"
"${CMAKE_SOURCE_DIR}/src/upnp.cpp"
"${CMAKE_SOURCE_DIR}/src/upnp.h"
"${CMAKE_SOURCE_DIR}/src/cbs.cpp"
"${CMAKE_SOURCE_DIR}/src/utility.h"
"${CMAKE_SOURCE_DIR}/src/uuid.h"
"${CMAKE_SOURCE_DIR}/src/config.h"
"${CMAKE_SOURCE_DIR}/src/config.cpp"
"${CMAKE_SOURCE_DIR}/src/entry_handler.cpp"
"${CMAKE_SOURCE_DIR}/src/entry_handler.h"
"${CMAKE_SOURCE_DIR}/src/file_handler.cpp"
"${CMAKE_SOURCE_DIR}/src/file_handler.h"
"${CMAKE_SOURCE_DIR}/src/globals.cpp"
"${CMAKE_SOURCE_DIR}/src/globals.h"
"${CMAKE_SOURCE_DIR}/src/logging.cpp"
"${CMAKE_SOURCE_DIR}/src/logging.h"
"${CMAKE_SOURCE_DIR}/src/main.cpp"
"${CMAKE_SOURCE_DIR}/src/main.h"
"${CMAKE_SOURCE_DIR}/src/crypto.cpp"
"${CMAKE_SOURCE_DIR}/src/crypto.h"
"${CMAKE_SOURCE_DIR}/src/nvhttp.cpp"
"${CMAKE_SOURCE_DIR}/src/nvhttp.h"
"${CMAKE_SOURCE_DIR}/src/httpcommon.cpp"
"${CMAKE_SOURCE_DIR}/src/httpcommon.h"
"${CMAKE_SOURCE_DIR}/src/confighttp.cpp"
"${CMAKE_SOURCE_DIR}/src/confighttp.h"
"${CMAKE_SOURCE_DIR}/src/rtsp.cpp"
"${CMAKE_SOURCE_DIR}/src/rtsp.h"
"${CMAKE_SOURCE_DIR}/src/stream.cpp"
"${CMAKE_SOURCE_DIR}/src/stream.h"
"${CMAKE_SOURCE_DIR}/src/video.cpp"
"${CMAKE_SOURCE_DIR}/src/video.h"
"${CMAKE_SOURCE_DIR}/src/video_colorspace.cpp"
"${CMAKE_SOURCE_DIR}/src/video_colorspace.h"
"${CMAKE_SOURCE_DIR}/src/input.cpp"
"${CMAKE_SOURCE_DIR}/src/input.h"
"${CMAKE_SOURCE_DIR}/src/audio.cpp"
"${CMAKE_SOURCE_DIR}/src/audio.h"
"${CMAKE_SOURCE_DIR}/src/platform/common.h"
"${CMAKE_SOURCE_DIR}/src/process.cpp"
"${CMAKE_SOURCE_DIR}/src/process.h"
"${CMAKE_SOURCE_DIR}/src/network.cpp"
"${CMAKE_SOURCE_DIR}/src/network.h"
"${CMAKE_SOURCE_DIR}/src/move_by_copy.h"
"${CMAKE_SOURCE_DIR}/src/system_tray.cpp"
"${CMAKE_SOURCE_DIR}/src/system_tray.h"
"${CMAKE_SOURCE_DIR}/src/task_pool.h"
"${CMAKE_SOURCE_DIR}/src/thread_pool.h"
"${CMAKE_SOURCE_DIR}/src/thread_safe.h"
"${CMAKE_SOURCE_DIR}/src/sync.h"
"${CMAKE_SOURCE_DIR}/src/round_robin.h"
"${CMAKE_SOURCE_DIR}/src/stat_trackers.h"
"${CMAKE_SOURCE_DIR}/src/stat_trackers.cpp"
"${CMAKE_SOURCE_DIR}/src/rswrapper.h"
"${CMAKE_SOURCE_DIR}/src/rswrapper.c"
${COMMON_SOURCES}
${PLATFORM_TARGET_FILES})

if(NOT SUNSHINE_ASSETS_DIR_DEF)
Expand Down
4 changes: 2 additions & 2 deletions cmake/targets/common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ else()
endif()

# src/upnp
set_source_files_properties("${CMAKE_SOURCE_DIR}/src/upnp.cpp"
set_source_files_properties("${CMAKE_SOURCE_DIR}/src/server/upnp.cpp"
DIRECTORY "${CMAKE_SOURCE_DIR}" "${TEST_DIR}"
PROPERTIES COMPILE_FLAGS -Wno-pedantic)

Expand All @@ -106,7 +106,7 @@ set_source_files_properties("${CMAKE_SOURCE_DIR}/third-party/ViGEmClient/src/ViG
string(TOUPPER "x${CMAKE_BUILD_TYPE}" BUILD_TYPE)
if("${BUILD_TYPE}" STREQUAL "XDEBUG")
if(WIN32)
set_source_files_properties("${CMAKE_SOURCE_DIR}/src/nvhttp.cpp"
set_source_files_properties("${CMAKE_SOURCE_DIR}/src/server/nvhttp.cpp"
DIRECTORY "${CMAKE_SOURCE_DIR}" "${CMAKE_SOURCE_DIR}/tests"
PROPERTIES COMPILE_FLAGS -O2)
endif()
Expand Down
1 change: 1 addition & 0 deletions src/audio.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#include "thread_safe.h"
#include "utility.h"

namespace audio {
enum stream_config_e : int {
STEREO, ///< Stereo
Expand Down
4 changes: 2 additions & 2 deletions src/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
#include "entry_handler.h"
#include "file_handler.h"
#include "logging.h"
#include "nvhttp.h"
#include "rtsp.h"
#include "server/nvhttp.h"
#include "server/rtsp.h"
#include "utility.h"

#include "platform/common.h"
Expand Down
6 changes: 3 additions & 3 deletions src/entry_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@

// local includes
#include "config.h"
#include "confighttp.h"
#include "entry_handler.h"
#include "globals.h"
#include "httpcommon.h"
#include "logging.h"
#include "network.h"
#include "platform/common.h"
#include "server/confighttp.h"
#include "server/httpcommon.h"
#include "server/network.h"
#include "version.h"

extern "C" {
Expand Down
Loading

0 comments on commit cadeff3

Please sign in to comment.