Moved source files to seperate folder
This commit is contained in:
@@ -6,6 +6,24 @@ project(Sunshine)
|
|||||||
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR})
|
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
add_subdirectory(Simple-Web-Server)
|
add_subdirectory(Simple-Web-Server)
|
||||||
add_subdirectory(moonlight-common-c/enet)
|
add_subdirectory(moonlight-common-c/enet)
|
||||||
|
|
||||||
|
find_package(X11 REQUIRED)
|
||||||
|
set(PLATFORM_TARGET_FILES
|
||||||
|
sunshine/platform/linux.cpp
|
||||||
|
sunshine/platform/linux_evdev.cpp)
|
||||||
|
|
||||||
|
set(PLATFORM_LIBRARIES
|
||||||
|
Xfixes
|
||||||
|
Xtst
|
||||||
|
${X11_LIBRARIES}
|
||||||
|
evdev
|
||||||
|
pulse
|
||||||
|
pulse-simple)
|
||||||
|
|
||||||
|
set(PLATFORM_INCLUDE_DIRS
|
||||||
|
${X11_INCLUDE_DIR}
|
||||||
|
/usr/include/libevdev-1.0)
|
||||||
|
|
||||||
set(SUNSHINE_TARGET_FILES
|
set(SUNSHINE_TARGET_FILES
|
||||||
moonlight-common-c/reedsolomon/rs.c
|
moonlight-common-c/reedsolomon/rs.c
|
||||||
moonlight-common-c/reedsolomon/rs.h
|
moonlight-common-c/reedsolomon/rs.h
|
||||||
@@ -39,43 +57,45 @@ set(SUNSHINE_TARGET_FILES
|
|||||||
moonlight-common-c/src/VideoDepacketizer.c
|
moonlight-common-c/src/VideoDepacketizer.c
|
||||||
moonlight-common-c/src/Video.h
|
moonlight-common-c/src/Video.h
|
||||||
moonlight-common-c/src/VideoStream.c
|
moonlight-common-c/src/VideoStream.c
|
||||||
utility.h
|
sunshine/utility.h
|
||||||
uuid.h
|
sunshine/uuid.h
|
||||||
config.h config.cpp
|
sunshine/config.h
|
||||||
main.cpp
|
sunshine/config.cpp
|
||||||
crypto.cpp crypto.h
|
sunshine/main.cpp
|
||||||
nvhttp.cpp nvhttp.h
|
sunshine/crypto.cpp
|
||||||
stream.cpp stream.h
|
sunshine/crypto.h
|
||||||
video.cpp video.h
|
sunshine/nvhttp.cpp
|
||||||
queue.h
|
sunshine/nvhttp.h
|
||||||
input.cpp input.h
|
sunshine/stream.cpp
|
||||||
audio.cpp audio.h
|
sunshine/stream.h
|
||||||
platform/linux.cpp
|
sunshine/video.cpp
|
||||||
platform/linux_evdev.cpp
|
sunshine/video.h
|
||||||
platform/common.h)
|
sunshine/queue.h
|
||||||
|
sunshine/input.cpp
|
||||||
|
sunshine/input.h
|
||||||
|
sunshine/audio.cpp
|
||||||
|
sunshine/audio.h
|
||||||
|
sunshine/platform/common.h
|
||||||
|
${PLATFORM_TARGET_FILES})
|
||||||
|
|
||||||
include_directories(
|
include_directories(
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}
|
${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/Simple-Web-Server
|
${CMAKE_CURRENT_SOURCE_DIR}/Simple-Web-Server
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/moonlight-common-c/enet/include
|
${CMAKE_CURRENT_SOURCE_DIR}/moonlight-common-c/enet/include
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/moonlight-common-c/reedsolomon
|
${CMAKE_CURRENT_SOURCE_DIR}/moonlight-common-c/reedsolomon
|
||||||
${X11_INCLUDE_DIR}
|
|
||||||
/usr/include/libevdev-1.0
|
|
||||||
${FFMPEG_INCLUDE_DIRS}
|
${FFMPEG_INCLUDE_DIRS}
|
||||||
|
${PLATFORM_INCLUDE_DIRS}
|
||||||
)
|
)
|
||||||
|
|
||||||
find_package(Threads REQUIRED)
|
find_package(Threads REQUIRED)
|
||||||
find_package(OpenSSL REQUIRED)
|
find_package(OpenSSL REQUIRED)
|
||||||
find_package(FFmpeg REQUIRED)
|
find_package(FFmpeg REQUIRED)
|
||||||
|
|
||||||
#FIXME: libX11 is Linux only
|
|
||||||
find_package(X11 REQUIRED)
|
|
||||||
|
|
||||||
list(APPEND SUNSHINE_COMPILE_OPTIONS -fPIC -Wall -Wno-missing-braces -Wno-maybe-uninitialized -Wno-sign-compare)
|
list(APPEND SUNSHINE_COMPILE_OPTIONS -fPIC -Wall -Wno-missing-braces -Wno-maybe-uninitialized -Wno-sign-compare)
|
||||||
string(TOUPPER ${CMAKE_BUILD_TYPE} BUILD_TYPE)
|
string(TOUPPER ${CMAKE_BUILD_TYPE} BUILD_TYPE)
|
||||||
if("x${BUILD_TYPE}" STREQUAL "xDEBUG")
|
if("x${BUILD_TYPE}" STREQUAL "xDEBUG")
|
||||||
list(APPEND SUNSHINE_COMPILE_OPTIONS -O0 -pedantic -ggdb3)
|
list(APPEND SUNSHINE_COMPILE_OPTIONS -O0 -pedantic -ggdb3)
|
||||||
elseif("x${BUILD_TYPE}" STREQUAL "xRELEASE")
|
else()
|
||||||
add_definitions(-DNDEBUG)
|
add_definitions(-DNDEBUG)
|
||||||
list(APPEND SUNSHINE_COMPILE_OPTIONS -O3)
|
list(APPEND SUNSHINE_COMPILE_OPTIONS -O3)
|
||||||
endif()
|
endif()
|
||||||
@@ -84,17 +104,9 @@ list(APPEND SUNSHINE_EXTERNAL_LIBRARIES
|
|||||||
${CMAKE_THREAD_LIBS_INIT}
|
${CMAKE_THREAD_LIBS_INIT}
|
||||||
${OPENSSL_LIBRARIES}
|
${OPENSSL_LIBRARIES}
|
||||||
enet
|
enet
|
||||||
Xfixes
|
|
||||||
Xtst
|
|
||||||
${X11_LIBRARIES}
|
|
||||||
${FFMPEG_LIBRARIES}
|
|
||||||
|
|
||||||
#FIXME: libpulse is linux only
|
|
||||||
pulse
|
|
||||||
pulse-simple
|
|
||||||
|
|
||||||
opus
|
opus
|
||||||
evdev)
|
${FFMPEG_LIBRARIES}
|
||||||
|
${PLATFORM_LIBRARIES})
|
||||||
|
|
||||||
add_definitions(-DSUNSHINE_ASSETS_DIR="${CMAKE_CURRENT_SOURCE_DIR}/assets")
|
add_definitions(-DSUNSHINE_ASSETS_DIR="${CMAKE_CURRENT_SOURCE_DIR}/assets")
|
||||||
add_executable(sunshine ${SUNSHINE_TARGET_FILES})
|
add_executable(sunshine ${SUNSHINE_TARGET_FILES})
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=Remote desktop service (VNC)
|
Description=Sunshine Gamestream Server for Moonlight
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
WorkingDirectory=/home/%u
|
WorkingDirectory=/home/%u
|
||||||
Environment="DISPLAY=:0"
|
Environment="DISPLAY=:0"
|
||||||
Type=simple
|
Type=simple
|
||||||
# wait for Xorg started by ${USER}
|
# wait for Xorg
|
||||||
ExecStartPre=/bin/sh -c 'while ! pgrep Xorg; do sleep 2; done'
|
ExecStartPre=/bin/sh -c 'while ! pgrep Xorg; do sleep 2; done'
|
||||||
ExecStart=/home/%u/Github/sunshine/cmake-build-release/sunshine
|
ExecStart=/home/%u/Github/sunshine/cmake-build-release/sunshine
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
#ifndef SUNSHINE_INPUT_H
|
#ifndef SUNSHINE_INPUT_H
|
||||||
#define SUNSHINE_INPUT_H
|
#define SUNSHINE_INPUT_H
|
||||||
|
|
||||||
#include <platform/common.h>
|
#include "platform/common.h"
|
||||||
|
|
||||||
namespace input {
|
namespace input {
|
||||||
void print(void *input);
|
void print(void *input);
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
#define SUNSHINE_COMMON_H
|
#define SUNSHINE_COMMON_H
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <utility.h>
|
#include "sunshine/utility.h"
|
||||||
|
|
||||||
namespace platf {
|
namespace platf {
|
||||||
|
|
||||||
@@ -11,7 +11,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "utility.h"
|
#include "sunshine/utility.h"
|
||||||
|
|
||||||
namespace platf {
|
namespace platf {
|
||||||
constexpr std::uint16_t DPAD_UP = 0x0001;
|
constexpr std::uint16_t DPAD_UP = 0x0001;
|
||||||
@@ -173,7 +173,7 @@ public:
|
|||||||
std::vector<char> full_payload;
|
std::vector<char> full_payload;
|
||||||
|
|
||||||
auto old_msg = std::move(_queue_packet);
|
auto old_msg = std::move(_queue_packet);
|
||||||
TUPLE_2D_REF(_, old_packet, old_msg);
|
TUPLE_2D(_, old_packet, std::move(_queue_packet));
|
||||||
|
|
||||||
|
|
||||||
std::string_view new_payload { (char*)packet->data, packet->dataLength };
|
std::string_view new_payload { (char*)packet->data, packet->dataLength };
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
|
|
||||||
#include <platform/common.h>
|
#include "platform/common.h"
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include <libavcodec/avcodec.h>
|
#include <libavcodec/avcodec.h>
|
||||||
Reference in New Issue
Block a user