Skip to main content

Requirements

  • Visual Studio 2019 or later (any edition, including Build Tools)
  • CMake >= 3.13
  • Ninja (bundled with Visual Studio, or install separately)
  • A pre-built OpenSSL distribution for Windows (e.g. from Shining Light or vcpkg)

Opening a developer prompt

All CMake commands must be run inside a Visual Studio Developer Command Prompt, or from a standard cmd/PowerShell session that has already sourced vcvarsall.bat:
"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" x64

Build

1

Clone the repository

git clone https://github.com/FreeRDP/FreeRDP.git C:\freerdp\src
2

Configure with CMake

cmake -GNinja ^
  -DCMAKE_BUILD_TYPE=Release ^
  -DWITH_VERBOSE_WINPR_ASSERT=OFF ^
  -DCMAKE_INSTALL_PREFIX=C:\freerdp\install ^
  -B C:\freerdp\build ^
  -S C:\freerdp\src
3

Compile and install

cmake --build C:\freerdp\build --target install

CI preload configuration

The repository ships ci/cmake-preloads/config-windows.txt with recommended Windows settings:
set(CMAKE_WINDOWS_VERSION "WIN7" CACHE STRING "windows build version")
set(BUILD_SHARED_LIBS OFF CACHE BOOL "build static linked executable")
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded" CACHE STRING "MSVC runtime to use")
set(OPENSSL_USE_STATIC_LIBS ON CACHE BOOL "link OpenSSL static")
set(WITH_SERVER ON CACHE BOOL "build with server")
set(WITH_CLIENT_SDL ON CACHE BOOL "build with SDL client")
set(CHANNEL_URBDRC OFF CACHE BOOL "USB redirection")
Apply it with:
cmake -C C:\freerdp\src\ci\cmake-preloads\config-windows.txt ^
  -GNinja ^
  -B C:\freerdp\build ^
  -S C:\freerdp\src

cmake --build C:\freerdp\build

Notable Windows flags

FlagDescription
BUILD_SHARED_LIBS=OFFProduce a statically linked executable.
OPENSSL_USE_STATIC_LIBS=ONLink OpenSSL statically.
CMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedUse the static MSVC runtime (/MT).
WITH_WIN_CONSOLE=ONAttach a console window to the client executable.
WITH_SHADOW=OFFDisable the shadow server (not supported on Windows).
WITH_CLIENT_SDL=ONBuild the SDL2 client.
WITH_SDL_LINK_SHARED=OFFLink SDL2 statically.
ZLIB_USE_STATIC_LIBS=ONLink zlib statically.

Build docs developers (and LLMs) love