Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,7 @@ package-lock.json
venv/

# Generated files
src_assets/common/assets/web/welcome.html
src_assets/common/assets/web/welcome.html

# CodeQL
_codeql_detected_source_root
9 changes: 9 additions & 0 deletions cmake/compile_definitions/common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,15 @@ set(SUNSHINE_TARGET_FILES
"${CMAKE_SOURCE_DIR}/src/stat_trackers.cpp"
"${CMAKE_SOURCE_DIR}/src/rswrapper.h"
"${CMAKE_SOURCE_DIR}/src/rswrapper.c"
"${CMAKE_SOURCE_DIR}/src/subprocess/ipc_protocol.h"
"${CMAKE_SOURCE_DIR}/src/subprocess/ipc_pipe.h"
"${CMAKE_SOURCE_DIR}/src/subprocess/ipc_pipe.cpp"
"${CMAKE_SOURCE_DIR}/src/subprocess/subprocess_config.h"
"${CMAKE_SOURCE_DIR}/src/subprocess/subprocess_config.cpp"
"${CMAKE_SOURCE_DIR}/src/subprocess/subprocess_manager.h"
"${CMAKE_SOURCE_DIR}/src/subprocess/subprocess_manager.cpp"
"${CMAKE_SOURCE_DIR}/src/subprocess/subprocess.h"
"${CMAKE_SOURCE_DIR}/src/subprocess/subprocess.cpp"
${PLATFORM_TARGET_FILES})

if(NOT SUNSHINE_ASSETS_DIR_DEF)
Expand Down
3 changes: 3 additions & 0 deletions cmake/targets/linux.cmake
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
# linux specific target definitions

# Build subprocess sender executable
add_subdirectory(src/sender)
3 changes: 3 additions & 0 deletions cmake/targets/windows.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# windows specific target definitions
set_target_properties(sunshine PROPERTIES LINK_SEARCH_START_STATIC 1)

# Build subprocess sender executable
add_subdirectory(src/sender)
set(CMAKE_FIND_LIBRARY_SUFFIXES ".dll")
find_library(ZLIB ZLIB1)
list(APPEND SUNSHINE_EXTERNAL_LIBRARIES
Expand Down
41 changes: 41 additions & 0 deletions src/sender/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# CMakeLists.txt for sunshine-sender subprocess
# This builds the sender executable that handles the data plane

set(SENDER_TARGET_FILES
"${CMAKE_SOURCE_DIR}/src/sender/sender_main.cpp"
"${CMAKE_SOURCE_DIR}/src/subprocess/ipc_pipe.cpp"
"${CMAKE_SOURCE_DIR}/src/subprocess/ipc_protocol.h"
)

add_executable(sunshine-sender ${SENDER_TARGET_FILES})

target_include_directories(sunshine-sender PRIVATE
"${CMAKE_SOURCE_DIR}"
)

target_compile_definitions(sunshine-sender PRIVATE
SUBPROCESS_STANDALONE=1
$<$<PLATFORM_ID:Windows>:WIN32_LEAN_AND_MEAN>
$<$<PLATFORM_ID:Windows>:NOMINMAX>
)

set_target_properties(sunshine-sender PROPERTIES
CXX_STANDARD 23
)

# Platform-specific libraries
if(WIN32)
target_link_libraries(sunshine-sender PRIVATE
ws2_32
)
else()
target_link_libraries(sunshine-sender PRIVATE
pthread
)
endif()

# Install sender alongside main executable
install(TARGETS sunshine-sender
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
COMPONENT Runtime
)
Loading