Skip to main content
FreeRDP uses CMake as its build system and supports Linux, macOS, Windows, Android, and iOS. This page covers the build system fundamentals. For platform-specific instructions follow the links at the bottom of this page.

Requirements

  • CMake >= 3.13
  • A C compiler (GCC, Clang, or MSVC)
  • Ninja (recommended) or another CMake-supported generator

Build types

Pass -DCMAKE_BUILD_TYPE=<type> to CMake to select a build type.
TypeDescription
ReleaseFully optimised, no debug symbols. Recommended for production.
RelWithDebInfoOptimised with debug symbols included.
DebugNo optimisations, full debug symbols.

General build example

Assume source is at /tmp/freerdp/src and you want to install to /tmp/freerdp/install:
cmake -GNinja \
  -DCMAKE_BUILD_TYPE=Release \
  -DWITH_VERBOSE_WINPR_ASSERT=OFF \
  -DCMAKE_PREFIX_PATH=/tmp/freerdp/install \
  -B /tmp/freerdp/build \
  -S /tmp/freerdp/src

cmake --build /tmp/freerdp/build --target install
On Windows this command must be run from a Visual Studio Developer Command Prompt or a cmd session that has already executed vcvarsall.bat. Paths must be adjusted for Windows conventions.

Key CMake flags

Build verbosity and assertions

FlagDefaultDescription
CMAKE_BUILD_TYPEBuild type: Debug, Release, RelWithDebInfo
WITH_VERBOSE_WINPR_ASSERTONEnables runtime sanity checks. Set to OFF for stable/release builds to reduce binary size.
CMAKE_VERBOSE_MAKEFILEOFFPrint each compiler command during the build.

SSL

FlagDescription
-DWITH_OPENSSL=ONUse OpenSSL (default). Also selects LibreSSL as a drop-in replacement.
-DWITH_MBEDTLS=ONUse MBedTLS (set -DWITH_OPENSSL=OFF first).
-DWITH_INTERNAL_MD4=ONShip internal MD4 when the SSL library has deprecated it.
-DWITH_INTERNAL_MD5=ONShip internal MD5 when the SSL library has deprecated it.
-DWITH_INTERNAL_RC4=ONShip internal RC4 when the SSL library has deprecated it.

Authentication

FlagDescription
-DWITH_KRB5=OFFDisable Kerberos (MIT or Heimdal). Enabled by default when found.
-DWITH_PCSC=OFFDisable PC/SC smartcard redirection.
-DWITH_PKCS11=OFFDisable PKCS#11 NLA smartcard logon.

JSON

FlagDescription
-DWITH_JSON_DISABLED=ONDisable JSON support (cJSON or json-c). Required for Azure logon.

H.264 / graphics

FlagDescription
-DWITH_OPENH264=ONEnable OpenH264 codec.
-DWITH_FFMPEG=ONEnable FFmpeg (x264 or OpenH264).
-DWITH_SWSCALE=ONEnable Swscale for high-DPI / smart-sizing.
-DWITH_CAIRO=ONEnable Cairo for high-DPI / smart-sizing.

Audio

FlagDescription
-DWITH_GSM=ONEnable GSM codec.
-DWITH_DSP_FFMPEG=ONUse FFmpeg for audio DSP.
-DWITH_DSP_EXPERIMENTAL=ONEnable experimental codecs (e.g. AAC encoding).

Platform support (Linux)

FlagDescription
-DWITH_X11=OFFDisable X11 client/server.
-DWITH_WAYLAND=OFFDisable Wayland client (wlfreerdp).
-DWITH_PULSE=OFFDisable PulseAudio.
-DWITH_ALSA=OFFDisable ALSA audio.
-DWITH_CUPS=OFFDisable CUPS printing.
-DWITH_FUSE=OFFDisable FUSE-based clipboard file transfer.
-DWITH_LIBSYSTEMD=OFFDisable journald logging.
-DCHANNEL_URBDRC=OFFDisable USB redirection channel.

Client and server

FlagDescription
-DWITH_CLIENT_SDL=OFFDisable the SDL2 client.
-DWITH_SERVER=OFFDisable server-side builds.
-DWITH_PROXY=OFFDisable the RDP proxy.
-DWITH_SHADOW=OFFDisable the shadow server.
-DWITH_SAMPLE=OFFDisable client/server samples.
-DWITH_WINPR_TOOLS=OFFDisable helper utilities (certificate/NTLM tools).

CMake preload files

The repository ships preload files under ci/cmake-preloads/ that capture recommended configurations for each platform. Apply one with:
cmake -C ci/cmake-preloads/config-linux-all.txt -GNinja -B build -S .
You can also use ccmake (Linux/macOS) for an interactive curses UI to inspect and change the current CMakeCache.txt.

Dependencies summary

DependencyRequirementNotes
SSL libraryRequiredOpenSSL (default), LibreSSL, or MBedTLS
KerberosOptionalMIT or Heimdal; disable with -DWITH_KRB5=OFF
cJSON / json-cOptionalAzure logon; disable with -DWITH_JSON_DISABLED=ON
OpenH264 / FFmpegOptionalH.264 graphics (GFX); required for Windows 8.1+ servers
Swscale / CairoOptionalHigh-DPI and smart-sizing
FAAC / FAAD2 / soxrOptionalAAC audio encode/decode/resample
libusb 1OptionalUSB redirection channel
ICURequired (Linux/Android)UTF-16 ↔ UTF-8 conversion
SDL2OptionalSDL client

Platform-specific guides

Linux

Ubuntu/Debian and Fedora build instructions.

macOS

Homebrew-based build with OpenSSL setup.

Windows

MSVC and MinGW cross-compilation.

Android

NDK and Android Studio build.

iOS

Xcode and iOS simulator build.