diff --git a/CMakeLists.txt b/CMakeLists.txt index 562da728017..56997b690e7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -102,7 +102,11 @@ else() ${X11_INCLUDE_DIR} /usr/include/libevdev-1.0) + if(NOT DEFINED SUNSHINE_EXECUTABLE_PATH) + set(SUNSHINE_EXECUTABLE_PATH "${CMAKE_CURRENT_BINARY_DIR}/sunshine") + endif() configure_file(gen-deb.in gen-deb @ONLY) + configure_file(sunshine.service.in sunshine.service @ONLY) endif() set(Boost_USE_STATIC_LIBS ON) diff --git a/appveyor.yml b/appveyor.yml index cd9c3830c10..a02d72fe6c5 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -30,7 +30,7 @@ before_build: build_script: - cmd: set OLDPATH=%PATH% - cmd: set PATH=C:\msys64\mingw64\bin - - sh: cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DSUNSHINE_ASSETS_DIR=/etc/sunshine .. + - sh: cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DSUNSHINE_EXECUTABLE_PATH=sunshine -DSUNSHINE_ASSETS_DIR=/etc/sunshine .. - cmd: cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DOPENSSL_ROOT_DIR=C:\OpenSSL-v111-Win64 -DSUNSHINE_STANDALONE=ON -DSUNSHINE_ASSETS_DIR=assets -G "MinGW Makefiles" .. - sh: make -j$(nproc) - cmd: mingw32-make -j2 @@ -38,10 +38,11 @@ build_script: after_build: - sh: ./gen-deb - - cmd: Del ..\assets\apps_linux.json ..\assets\sunshine.service + - cmd: Del ..\assets\apps_linux.json - cmd: 7z a Sunshine-Windows.zip ..\assets - cmd: 7z a Sunshine-Windows.zip sunshine.exe - cmd: 7z a Sunshine-Windows.zip tools\dxgi-info.exe - cmd: 7z a Sunshine-Windows.zip tools\audio-info.exe - cmd: appveyor PushArtifact Sunshine-Windows.zip - sh: appveyor PushArtifact package-deb/sunshine.deb + - sh: appveyor PushArtifact sunshine.service diff --git a/assets/sunshine.service b/sunshine.service.in similarity index 79% rename from assets/sunshine.service rename to sunshine.service.in index b365fa9a9f2..802442df99f 100644 --- a/assets/sunshine.service +++ b/sunshine.service.in @@ -7,7 +7,7 @@ Environment="DISPLAY=:0" Type=simple # wait for Xorg ExecStartPre=/bin/sh -c 'while ! pgrep Xorg; do sleep 2; done' -ExecStart=/home/%u/Github/sunshine/cmake-build-release/sunshine +ExecStart=@SUNSHINE_EXECUTABLE_PATH@ [Install] WantedBy=default.target