Compiling - dagelf/synergy-core GitHub Wiki

Before you can compile, you'll need the source code. Follow the Getting Started guide for help with this.

Also, this guide is for compiling Synergy Core v1.9 and up (including v2.0). If using v1.3.5 to v1.8, follow the Compiling Legacy guide.

Dependencies

Important: Please also reflect changes in the Core Compiling guide.

Windows

  1. Install Git for Windows
  2. Install Visual Studio Professional 2015 with Updates
    1. Select Custom
    2. Deselect all
    3. Within Programming Languages, select Visual C++
    4. Git for Windows should already be installed
  3. Download the Windows 10 SDK Web Installer
    1. Click Download the installer (not the iso)
    2. Use default options for first 2 screens
    3. On the feature screen, untick everything except Debugging Tools for Windows
  4. Install Bonjour
    1. Download: Bonjour SDK for Windows v3.0
  5. Install Qt
    1. Install to C:\Qt
    2. Select Qt 5.9.5
  6. Add 'C:\Qt\Tools\QtCreator\bin' to the system PATH
  7. Install CMake
    1. Add CMake to PATH for all users
  8. Restart Qt
  9. Set CMAKE_PREFIX_PATH environment variable to \path\to\qt\qt_version\msvc2015_64
  10. Now follow the compile steps below

macOS

  1. Install Homebrew
  2. Install XCode (also available via the Mac App Store)
    1. Update the command line tools setting - Preferences -> Locations
    2. In the Command Line Tools drop down, select "Xcode 9.4"
  3. Install the latest version of Qt 5.9 Qt (5.9.6 as of Jun 11/18)
    1. Choose open source option
    2. Run package manager
    3. Select Qt 5.9.x and unselect everything other than macOS
    4. At bottom of list ensure Qt Creator is selected under "Tools"
    5. Select Continue and agree to terms
  4. Install cmake, openssl, libsodium using Homebrew: brew install cmake openssl libsodium
  5. Now follow the compile steps below

Ubuntu 16.04 and up

  1. $ sudo apt install qtcreator qtbase5-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
  2. Edit the Qt kit environment field (Manage Kits in Projects) and add BOOST_ROOT=/home/<user>/boost

CentOS 7

sudo yum groupinstall "Development Tools"
sudo yum -y install epel-release cmake3 boost-static git libXtst-devel qt5-qtbase-devel qt5-qtdeclarative-devel libcurl-devel openssl-devel

Fedora 28 (may work for earlier releases)

sudo yum groupinstall "Development Tools"
sudo yum -y install avahi-compat-libdns_sd-devel avahi-compat-libdns_sd cmake3 boost-static git libXtst-devel qt5-qtbase-devel qt5-qtdeclarative-devel libcurl-devel openssl-devel

SUSE Linux 12 SP3

sudo zypper install avahi-compat-mDNSResponder-devel libavahi-devel libqt5-qtbase-devel cmake libopenssl-devel libcurl-devel libXtst-devel

Compile Steps

Make sure you have completed the steps at Getting Started.

IDE Compile

Compiling from the IDE (e.g. Qt Creator).

macOS Only

Do this first on macOS.

  1. Qt Creator > Preferences > Build & Run > CMake
  2. Click Add, set Path to: /usr/local/bin/cmake
  3. Go to the Kits tab
  4. Set the C compiler to Clang 64-bit
  5. Restart Qt Creator

All OSes

  1. Open Qt Creator
  2. If macOS, follow macOS Only steps
  3. Open Project
  4. Navigate to the project directory (from git clone)
  5. Open CMakeLists.txt
  6. Untick "Imported Kit"
  7. Expand "Desktop Qt..."
  8. Untick all except Debug and Release
  9. Right-click project and select Run CMake
  10. If macOS, follow macOS Post-CMake steps
  11. Right-click project and select Build

macOS Post-CMake

  1. Open Projects
  2. Select Build
  3. Find CMAKE_OSX_DEPLOYMENT_TARGET
  4. Set value to 10.10
  5. Find CMAKE_OSX_SYSROOT
  6. Set value to /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/
  7. Click Apply Configuration Changes
  8. Go back to the All OSes steps (above)

CLI Compile

Compiling from the command line.

Windows

cd Projects\synergy
mkdir build
cd build
call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat"
cmake -G "Visual Studio 14 2015 Win64" -DCMAKE_BUILD_TYPE=Debug ..
msbuild synergy-core.sln /p:Platform="x64" /p:Configuration=Debug /m

macOS

cd Projects/synergy
mkdir build
cd build
QT_PATH=$HOME/Qt/5.9.3/clang_64
export PATH=$PATH:/usr/local/bin:$QT_PATH/bin
#cmake -DCMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -DOSX_TARGET_MAJOR=10 -DOSX_TARGET_MINOR=12 -DCMAKE_OSX_ARCHITECTURES=x86_64 ..
cmake  -DCMAKE_OSX_DEPLOYMENT_TARGET=10.10 -DCMAKE_OSX_ARCHITECTURES=x86_64 -DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE -DCMAKE_CONFIGURATION_TYPES=$CMAKE_BUILD_TYPE ..
make

Linux

cd Projects/synergy
mkdir build
cd build
cmake ..
make
⚠️ **GitHub.com Fallback** ⚠️