Documentation
- ๐ Welcome to the CMake RE Documentation
- ๐ Getting started with CMake RE for C++
- ๐ธ Custom build systems
- ๐ฆ Getting started with CMake RE for Rust (alpha)
- Key Principles and Goals
- ๐ชฉ Developer Machine Digital Twin
- ๐ฉ๐ผโ๐ป cmake-re --help | Command Line Reference
- โก๏ธ L2 Distributed Builds & Caching
- ๐ฆ L2 remote caching for Ccache
- ๐ฆ L1 Build cache
- ๐ฆ L1 Build Cache Sharing
- ๐ฆ FetchContent() and Package Managers
- ๐ป Environments
- ๐ป Environment Layers Specifications
- ๐ป Self-hosted runners
- Authentication
- Ignore and exclude - Caching and Mirroring
- Accessing hermetic builds folders
- Continuous integration
- Environment variables
- ๐ก๏ธ Data Security and Privacy
- tipi - ๐ฎ EXPERIMENTAL - CMakeLists.txt Generator
- tipi - ๐ฎ EXPERIMENTAL - Getting started with tipi CMakeLists generator
- tipi - Compile options
- tipi - Integrated Package Manager
- tipi - Running tests
- tipi - IDE Integration
๐ธ Custom build systems
While cmake-re is optimized for CMake-based builds, it can also operate as compiler/linker/archiver launcher โ making it compatible with other build systems that are not directly supported (autotools, Make, Ninja, MSBuild) or usable as distcc, ccache, sccache alternative.
In this mode of operation it can delivers most of the performances benefits of โก๏ธ L2 Distributed Builds & Caching, here follows how to use it.
The binary of cmake-re is distributed with the following tools :
tipi-compiler-drivertipi-linker-drivertipi-ar-drivertipi-ranlib-driverreproxyrewrapper
Ecosystems and tools supported automatically
C&C++: gcc, clang, msvc, ar, ranlib, ld, gold, lld, mold...Java: javacTypeScript: tsc
env:RBE_labels="type=tool" : custom tools support
Custom tool support can be added by specifying the following environment variables that are consumed by rewrapper to control inputs and remote execution context:
env:RBE_labels="type=tool"env:RBE_input_list_pathsenv:RBE_output_list_paths
- Install necessary tools
# Linux & MacOS:
/bin/bash -c \
"$(curl -fsSL https://raw.githubusercontent.com/tipi-build/cli/master/install/install_for_macos_linux.sh)"
# Windows 10 / 11 in Powershell
[Net.ServicePointManager]::SecurityProtocol = "Tls, Tls11, Tls12, Ssl3"
. { `
iwr -useb https://raw.githubusercontent.com/tipi-build/cli/master/install/install_for_windows.ps1 `
} | iex
-
Setup a virtual environment with
tipi run bash/tipi.exe run cmd -
Authenticate to the remote caching service by setting
RBE_service,RBE_tls_client_auth_key,RBE_tls_client_auth_cert -
Start remote execution proxy
export RBE_exec_root=$PWD
export RBE_platform="InputRootAbsolutePath=$PWD"
# Start remote execution proxy
touch $PWD.unix-sock-reproxy
export RBE_server_address=unix://$PWD.unix-sock-reproxy
export RBE_reproxy_wait_seconds=5
export RBE_service_no_auth="true"
export RBE_use_application_default_credentials="true"
reproxy &
- Override compiler, linker and archiver command invocations.
Autotools / Makefiles
export CXX="tipi-compiler-driver c++"
export CC="tipi-compiler-driver cc"
export LD="tipi-linker-driver /usr/bin/ld"
export AR="tipi-ranlib-driver /usr/bin/ar"
export RANLIB="tipi-ranlib-driver /usr/bin/ranlib"
# Configuration
./configure
# Build
# Caching is better disabled during configuration steps.
# When the environment vairable TIPI_INTERCALATED_COMPILER_LAUNCHER is not set,
# no calls to the RE-APIs are made and all work is local.
# The compiler invocations for configuration purposes are faster to run
# locally as they are usually using temporary files that can't be cached.
export TIPI_INTERCALATED_COMPILER_LAUNCHER=rewrapper
make
####ย Visual Studio msbuild
If you have a CMake codebase we advice to use the cmake-re wrapper but if you use self-maintained Visual Studio Solution, an integration could be done in the following way :
Edit <project>.vcxproj, and append at the end after the line importing Microsoft.Cpp.targets :
<PropertyGroup>
<CLToolExe>tipi-compiler-driver.exe</CLToolExe>
<CLToolPath>c:\.tipi\tipi-compiler-driver\<cmake-re-release-hash>\</CLToolPath>
</PropertyGroup>
Found an error or want to add more info? Write an issue or contribute changes to this documentation at tipi-build/docs on