Added windows build script.

master
Dominik Deák 5 years ago
parent 2f8910df06
commit 2568d14fd7
No known key found for this signature in database
GPG Key ID: 85514EC0CCE7007C
  1. 2
      Synergy-Core
  2. 155
      buildWindows.cmd
  3. 1220
      readme.html
  4. 40
      readme.md

@ -1 +1 @@
Subproject commit c579858dd23739aa6ed12928fd4f3c7c23d9130f
Subproject commit 36984104ec98aa4d03206d654746113c865e507d

@ -0,0 +1,155 @@
@echo off
set libQtPath=c:\Qt\Qt5.12.9\5.12.9\msvc2017_64
if not exist "%libQtPath%" (
echo "error: Unable to resolve Qt library. Make sure the 'libQtPath' variable is correct."
exit 1
)
rem https://docs.microsoft.com/en-us/cpp/build/building-on-the-command-line?view=vs-2019
set vcvarsallCommand=c:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat
if not exist "%vcvarsallCommand%" (
echo "error: Unable to resolve vcvarsall command file. Make sure the 'vcvarsallCommand' variable is correct."
exit 1
)
set upstreamURL=https://github.com/DEAKSoftware/Synergy-Binaries.git
for /F "tokens=* USEBACKQ" %%F in (`git config --get remote.origin.url`) do (
set queriedURL=%%F
)
if "%upstreamURL%" NEQ "%queriedURL%" (
echo "error: Unrecognised Git upstream URL. This script must run within the top-level directory of the Synergy-Binaries repository."
exit 1
)
for /F "tokens=* USEBACKQ" %%F in (`git rev-parse --show-toplevel`) do (
set toplevelPath=%%F
)
if "%toplevelPath%" EQU "" (
echo "error: Unrecognised top-level directory. This script must run within the top-level directory of the Synergy-Binaries repository."
exit 1
)
set synergyCorePath=%toplevelPath%\Synergy-Core
set buildPath=%synergyCorePath%\build
set binariesPath=%toplevelPath%\Binaries
set toolsPath=%toplevelPath%\Tools
call "%vcvarsallCommand%" x64
:main
call :configure
call :buildMSI
exit 0
:configureSubmodules
git submodule update --init --remote --recursive
exit /b 0
:configureCMake
cmake -S "%synergyCorePath%" -B "%buildPath%" -G "Visual Studio 16 2019" -D CMAKE_PREFIX_PATH="%libQtPath%" -D CMAKE_BUILD_TYPE=MINSIZEREL -D SYNERGY_ENTERPRISE=ON
if %errorlevel% equ 1 exit 1
exit /b 0
:configureVersion
call "%buildPath%\version.bat"
set synergyVersion=%SYNERGY_VERSION_MAJOR%.%SYNERGY_VERSION_MINOR%.%SYNERGY_VERSION_PATCH%
set synergyVersionStage=%SYNERGY_VERSION_STAGE%
exit /b 0
:configure
call :configureSubmodules
call :configureCMake
call :configureVersion
exit /b 0
:buildMSBuild
pushd "%buildPath%"
if %errorlevel% equ 1 exit 1
msbuild synergy-core.sln /p:Platform="x64" /p:Configuration=Release /m
if %errorlevel% equ 1 exit 1
popd
exit /b 0
:buildZIP
setlocal
set inputPath=%buildPath%\bin\Release
set outputPath=%binariesPath%\Synergy-%synergyVersion%-%synergyVersionStage%-x64
mkdir "%outputPath%"
copy "%inputPath%\libEGL.dll" "%outputPath%"
copy "%inputPath%\libGLESv2.dll" "%outputPath%"
copy "%inputPath%\Qt5Core.dll" "%outputPath%"
copy "%inputPath%\Qt5Gui.dll" "%outputPath%"
copy "%inputPath%\Qt5Network.dll" "%outputPath%"
copy "%inputPath%\Qt5Svg.dll" "%outputPath%"
copy "%inputPath%\Qt5Widgets.dll" "%outputPath%"
copy "%inputPath%\synergy.exe" "%outputPath%"
copy "%inputPath%\synergyc.exe" "%outputPath%"
copy "%inputPath%\synergyd.exe" "%outputPath%"
copy "%inputPath%\synergys.exe" "%outputPath%"
copy "%inputPath%\syntool.exe" "%outputPath%"
mkdir "%outputPath%\Platforms"
copy "%inputPath%\Platforms" "%outputPath%\Platforms"
mkdir "%outputPath%\OpenSSL"
copy "%synergyCorePath%\ext\openssl\windows\x64\bin\*" "%outputPath%\OpenSSL"
endlocal
exit /b 0
:buildMSI
pushd "%buildPath%\installer"
if %errorlevel% equ 1 exit 1
msbuild Synergy.sln /p:Configuration=Release
if %errorlevel% equ 1 exit 1
popd
copy "%buildPath%\installer\bin\Release\Synergy.msi" "%binariesPath%"
if %errorlevel% equ 1 exit 1
ren "%binariesPath%\Synergy.msi" "Synergy-%synergyVersion%-%synergyVersionStage%-x64.msi"
exit /b 0
:buildClean
pushd "%synergyCorePath%"
if %errorlevel% equ 1 exit 1
git clean -fdx
popd
pushd "%toplevelPath%"
if %errorlevel% equ 1 exit 1
git clean -fdx
popd
exit /b 0

File diff suppressed because one or more lines are too long

@ -25,7 +25,7 @@ The following files or directories should be of interest:
File / Directory | Description
--- | ---
[`Binaries`](./Binaries) | Output location for the build binaries.
`Synergy-Core` | The official Synergy Core submodule.
[`Synergy-Core`]((https://github.com/symless/synergy-core/) | The official Synergy Core submodule.
[`Tools`](./Tools) | Temporary location for build tools.
[`buildLinux.sh`](./buildLinux.sh) | Shell script for building binaries in Linux Mint or Ubuntu.
@ -52,9 +52,15 @@ Before you begin building Synergy, you need to recursively clone this project an
### Prerequisites
Install the following packages:
Install the following tools and dependencies:
sudo apt-get install qtcreator qtbase5-dev qttools5-dev cmake make g++ xorg-dev libssl-dev libx11-dev libsodium-dev libgl1-mesa-glx libegl1-mesa libcurl4-openssl-dev libavahi-compat-libdnssd-dev qtdeclarative5-dev libqt5svg5-dev libsystemd-dev
sudo apt-get install \
cmake g++ libavahi-compat-libdnssd-dev \
libcurl4-openssl-dev libegl1-mesa \
libgl1-mesa-glx libqt5svg5-dev libsodium-dev \
libssl-dev libsystemd-dev libx11-dev \
make qtbase5-dev qtcreator qtdeclarative5-dev \
qttools5-dev xorg-dev
For building Debian packages:
@ -64,7 +70,7 @@ Alternatively, consult the [official wiki](https://github.com/symless/synergy-co
### Building
Run the shell script with `buildLinux.sh --all` to build all packages. For other options, run with the `--help` switch.
Run the shell script `buildLinux.sh --all` to build all packages. For other options, run with the `--help` switch.
Alternatively, you can opt to build the binaries only, as detailed below. We're assuming the current path is in the `Synergy-Binaries` project root.
@ -98,11 +104,33 @@ Substitute the `ClientName` with the local machine name, and the Synergy server
## macOS
_Incomplete._
-->
## Windows
_Incomplete._
-->
### Prerequisites
1. Install the following tools and dependencies:
* [Git for Windows](https://gitforwindows.org/)
* [CMake](https://cmake.org/)
* [Visual Studio 2019](https://visualstudio.microsoft.com/downloads/), select the following components:
* VS 2019 C++ x64/x86 build tools
* Windows 10 SDK
* [WiX Toolset](https://wixtoolset.org/releases/), install the following components:
* WiX Toolset Build Tools
* WiX Toolset Visual Studio 2019 Extension
* [Qt 5](https://www.qt.io/download), select the following components:
* Qt 5.12.9, MSVC 2017 64-bit
2.
### Building
Run the command script `buildWindows.cmd --all` to build all packages. For other options, run with the `--help` switch.
Alternatively, you can opt to build the binaries only, as detailed below. We're assuming the current path is in the `Synergy-Binaries` project root.
## Disclaimers and Legal

Loading…
Cancel
Save