Work on build scripts.

master
Dominik Deák 5 years ago
parent a8f2806515
commit 33b090e05d
No known key found for this signature in database
GPG Key ID: 85514EC0CCE7007C
  1. 2
      Synergy-Core
  2. 15
      buildWindows.cmd
  3. 64
      readme.md

@ -1 +1 @@
Subproject commit 2316663352c5c505ef115a49f4fcda16e518808b Subproject commit 36984104ec98aa4d03206d654746113c865e507d

@ -1,15 +1,19 @@
@echo off @echo off
rem Path to the Qt library, Visual C++, 64-bit build.
set libQtPath=c:\Qt\Qt5.12.9\5.12.9\msvc2017_64 set libQtPath=c:\Qt\Qt5.12.9\5.12.9\msvc2017_64
rem Visual Studio environment variables, see: 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
rem Run 'cmake --help' to choose the suitable generator for your current tool chain.
set cmakeGenerator=Visual Studio 16 2019
if not exist "%libQtPath%" ( if not exist "%libQtPath%" (
echo error: Unable to resolve Qt library. Make sure the 'libQtPath' variable is correct. echo error: Unable to resolve Qt library. Make sure the 'libQtPath' variable is correct.
exit 1 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%" ( if not exist "%vcvarsallCommand%" (
echo error: Unable to resolve vcvarsall command file. Make sure the 'vcvarsallCommand' variable is correct. echo error: Unable to resolve vcvarsall command file. Make sure the 'vcvarsallCommand' variable is correct.
exit 1 exit 1
@ -94,7 +98,7 @@ exit 0
:configureCMake :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 cmake -S "%synergyCorePath%" -B "%buildPath%" -G "%cmakeGenerator%" -D CMAKE_PREFIX_PATH="%libQtPath%" -D CMAKE_BUILD_TYPE=MINSIZEREL -D SYNERGY_ENTERPRISE=ON
if %errorlevel% equ 1 exit 1 if %errorlevel% equ 1 exit 1
exit /b 0 exit /b 0
@ -102,8 +106,7 @@ exit 0
call "%buildPath%\version.bat" call "%buildPath%\version.bat"
set synergyVersion=%SYNERGY_VERSION_MAJOR%.%SYNERGY_VERSION_MINOR%.%SYNERGY_VERSION_PATCH% set synergyVersion=%SYNERGY_VERSION_MAJOR%.%SYNERGY_VERSION_MINOR%.%SYNERGY_VERSION_PATCH%
set synergyVersionStage=%SYNERGY_VERSION_STAGE% set synergyReleaseName=synergy-%synergyVersion%-windows-x64
set synergyReleaseName=synergy-%synergyVersion%-%synergyVersionStage%-windows-x64
exit /b 0 exit /b 0
:configure :configure

@ -28,11 +28,18 @@ File / Directory | Description
[`Synergy-Core`](https://github.com/symless/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. [`Tools`](./Tools) | Temporary location for build tools.
[`buildLinux.sh`](./buildLinux.sh) | Shell script for building binaries in Linux Mint or Ubuntu. [`buildLinux.sh`](./buildLinux.sh) | Shell script for building binaries in Linux Mint or Ubuntu.
[`buildWindows.cmd`](./buildWindows.cmd) | Command script for building binaries in Windows.
<!-- <!-- [`buildMacOS.sh`](./buildMacOS.sh) | Shell script for building binaries in macOS. -->
[`buildMacOS.sh`](./buildMacOS.sh) | Shell script for building binaries in macOS.
[`buildWindows.ps1`](./buildWindows.ps1) | PowerShell script for building binaries in Windows.
--> ## Official Documentation
If you choose to build Synergy manually, consult the following official documentation:
* [Compiling](https://github.com/symless/synergy-core/wiki/Compiling)
* [Compiling Synergy Core](https://github.com/symless/synergy-core/wiki/Compiling-Synergy-Core)
* [Building the Windows MSI Package](https://github.com/symless/synergy-core/wiki/Building-the-Windows-MSI-Package)
## Cloning the Repository ## Cloning the Repository
@ -66,31 +73,27 @@ For building Debian packages:
sudo apt-get install build-essential devscripts dh-make lintian sudo apt-get install build-essential devscripts dh-make lintian
Alternatively, consult the [official wiki](https://github.com/symless/synergy-core/wiki/Compiling) for installing dependencies.
### Building ### Building
Run the shell script `buildLinux.sh --all` to build all packages. For other options, run with the `--help` switch. **Easy Mode:**
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. Run the shell script `buildLinux.sh --all` to build all packages. For other options, run with the `--help` switch.
1. Create a `build` subdirectory in the `Synergy-Core` submodule:
cd Synergy-Core **Hard Mode:**
mkdir build
cd build
2. Configure the project: 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.
cmake .. -D CMAKE_BUILD_TYPE=MINSIZEREL -D SYNERGY_ENTERPRISE=ON cd Synergy-Core
mkdir build
cd build
3. Build the project: cmake .. -D CMAKE_BUILD_TYPE=MINSIZEREL -D SYNERGY_ENTERPRISE=ON
cmake --build . --parallel 8 cmake --build . --parallel 8
4. Optional, install the application: Optional, install the application:
sudo cmake --install . sudo cmake --install .
### Launching Automatically ### Launching Automatically
@ -123,14 +126,35 @@ _Incomplete._
* [Qt 5](https://www.qt.io/download), select the following components: * [Qt 5](https://www.qt.io/download), select the following components:
* Qt 5.12.9, MSVC 2017 64-bit * Qt 5.12.9, MSVC 2017 64-bit
2. 2. Edit the `buildWindows.cmd` script and make sure the following script variables are configured properly:
* `libQtPath` - Path to the Qt library, Visual C++, 64-bit build.
* `vcvarsallCommand` - Path to Visual Studio's `vcvarsall.bat` command script, which sets compiler environment variables. See [Microsoft C++ toolset](https://docs.microsoft.com/en-us/cpp/build/building-on-the-command-line?view=vs-2019) documentation for details.
* `cmakeGenerator` - Specifies the "generator" setting for cmake. Run `cmake --help` to choose the suitable generator for your current tool chain.
### Building ### Building
**Easy Mode:**
Run the command script `buildWindows.cmd --all` to build all packages. For other options, run with the `--help` switch. Run the command script `buildWindows.cmd --all` to build all packages. For other options, run with the `--help` switch.
**Hard Mode:**
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. 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.
cd Synergy-Core
mkdir build
cd build
call "c:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" x64
cmake .. -G "Visual Studio 16 2019" -D CMAKE_PREFIX_PATH="c:\Qt\Qt5.12.9\5.12.9\msvc2017_64" -D CMAKE_BUILD_TYPE=MINSIZEREL -D SYNERGY_ENTERPRISE=ON
msbuild synergy-core.sln /p:Platform="x64" /p:Configuration=Release /m
You may need to use different paths to `vcvarsall.bat` and Qt libraries, whatever is appropriate for your system. Consequently, the generator `-G` switch for `cmake` must also reflect the tool chain environment. See `cmake --help` for details.
## Disclaimers and Legal ## Disclaimers and Legal

Loading…
Cancel
Save