Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ Updates to ./build.sh and ./build.cmd should be accompanied by updates to this f
./build.sh release-tests # Release build with tests
./build.sh release-examples # Release build with examples
./build.sh build-all # All of the above
./build.sh clean # Clean build artifacts
./build.sh clean-all # Full clean (C++ + Rust targets)
./build.sh clean # Clean build artifacts + local-install
./build.sh clean-all # Full clean (C++ + local-install + Rust targets)
```

**Requirements:** CMake 3.20+, C++17, Rust toolchain (cargo), protoc. On macOS: `brew install cmake ninja protobuf abseil spdlog`. On Linux: see the CI workflow for apt packages.
Expand Down
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ git lfs pull

**Linux/macOS:**
```bash
./build.sh clean # Clean CMake build artifacts
./build.sh clean-all # Deep clean (C++ + Rust + generated files)
./build.sh clean # Clean CMake build artifacts + local-install
./build.sh clean-all # Deep clean (C++ + Rust + local-install + generated files)
./build.sh debug # Build Debug version
./build.sh release # Build Release version
./build.sh debug-examples # Build Debug with examples
Expand All @@ -74,8 +74,8 @@ git lfs pull
**Windows**
Using build scripts:
```powershell
.\build.cmd clean # Clean CMake build artifacts
.\build.cmd clean-all # Deep clean (C++ + Rust + generated files)
.\build.cmd clean # Clean CMake build artifacts + local-install
.\build.cmd clean-all # Deep clean (C++ + Rust + local-install + generated files)
.\build.cmd debug # Build Debug version
.\build.cmd release # Build Release version
.\build.cmd debug-examples # Build Debug with examples
Expand Down Expand Up @@ -135,14 +135,15 @@ cmake --build --preset macos-release
📖 **For complete build instructions, troubleshooting, and platform-specific notes, see [README_BUILD.md](README_BUILD.md)**

### Building with Docker
The Dockerfile COPYs folders/files required to build the CPP SDK into the image.
The Docker setup is split into a reusable base image and an SDK image layered on top of it.
**NOTE:** this has only been tested on Linux
```bash
docker build -t livekit-cpp-sdk . -f docker/Dockerfile
docker build -t livekit-cpp-sdk-base . -f docker/Dockerfile.base
docker build --build-arg BASE_IMAGE=livekit-cpp-sdk-base -t livekit-cpp-sdk . -f docker/Dockerfile.sdk
docker run -it --network host livekit-cpp-sdk:latest bash
```

__NOTE:__ if you are building your own Dockerfile, you will likely need to set the same `ENV` variables as in `docker/Dockerfile`, but to the relevant directories:
__NOTE:__ if you are building your own Dockerfile, you will likely need to set the same `ENV` variables as in `docker/Dockerfile.base`, but to the relevant directories:
```bash
export CC=$HOME/gcc-14/bin/gcc
export CXX=$HOME/gcc-14/bin/g++
Expand Down Expand Up @@ -487,7 +488,7 @@ cargo build -p yuv-sys -vv
```

### Full clean (Rust + C++ build folders)
In some cases, you may need to perform a full clean that deletes all build artifacts from both the Rust and C++ folders:
In some cases, you may need to perform a full clean that deletes all build artifacts from both the Rust and C++ folders, plus the local install folder:
```bash
./build.sh clean-all
```
Expand Down
3 changes: 3 additions & 0 deletions benchmarks/data_track_throughput/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*env*/
*/__pycache__/
*throughput_results/*
90 changes: 90 additions & 0 deletions benchmarks/data_track_throughput/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# Copyright 2026 LiveKit, Inc.
#
# Standalone CMake build for the data-track throughput experiment.
# All paths are relative to CMAKE_CURRENT_SOURCE_DIR so this directory
# can be moved or renamed freely.

cmake_minimum_required(VERSION 3.20)
project(DataTrackThroughput LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# ---- Dependencies --------------------------------------------------------

find_package(LiveKit CONFIG REQUIRED)

find_package(nlohmann_json 3.11 QUIET)
if(NOT nlohmann_json_FOUND)
include(FetchContent)
FetchContent_Declare(
nlohmann_json
GIT_REPOSITORY https://github.com/nlohmann/json.git
GIT_TAG v3.11.3
GIT_SHALLOW TRUE
)
FetchContent_MakeAvailable(nlohmann_json)
endif()

# ---- Targets -------------------------------------------------------------

set(_targets DataTrackThroughputProducer DataTrackThroughputConsumer)

add_executable(DataTrackThroughputProducer producer.cpp)
add_executable(DataTrackThroughputConsumer consumer.cpp)

foreach(_target ${_targets})
target_include_directories(${_target} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}")
target_link_libraries(${_target} PRIVATE LiveKit::livekit nlohmann_json::nlohmann_json)
endforeach()

# ---- RPATH ---------------------------------------------------------------

if(UNIX)
if(APPLE)
set_target_properties(${_targets} PROPERTIES
BUILD_RPATH "@loader_path"
INSTALL_RPATH "@loader_path"
)
else()
set_target_properties(${_targets} PROPERTIES
BUILD_RPATH "$ORIGIN"
INSTALL_RPATH "$ORIGIN"
BUILD_RPATH_USE_ORIGIN TRUE
)
endif()
endif()

# ---- Copy SDK shared libraries next to executables -----------------------

get_target_property(_lk_location LiveKit::livekit IMPORTED_LOCATION)
if(NOT _lk_location)
get_target_property(_lk_location LiveKit::livekit IMPORTED_LOCATION_RELEASE)
endif()
if(NOT _lk_location)
get_target_property(_lk_location LiveKit::livekit IMPORTED_LOCATION_DEBUG)
endif()
if(_lk_location)
get_filename_component(_lk_lib_dir "${_lk_location}" DIRECTORY)
endif()

if(_lk_lib_dir)
if(WIN32)
file(GLOB _sdk_shared_libs "${_lk_lib_dir}/../bin/*.dll" "${_lk_lib_dir}/*.dll")
elseif(APPLE)
file(GLOB _sdk_shared_libs "${_lk_lib_dir}/*.dylib")
else()
file(GLOB _sdk_shared_libs "${_lk_lib_dir}/*.so" "${_lk_lib_dir}/*.so.*")
endif()

foreach(_target ${_targets})
foreach(_lib ${_sdk_shared_libs})
get_filename_component(_lib_name "${_lib}" NAME)
add_custom_command(TARGET ${_target} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${_lib}" "$<TARGET_FILE_DIR:${_target}>/${_lib_name}"
COMMENT "Copying ${_lib_name} next to ${_target}"
)
endforeach()
endforeach()
endif()
Loading
Loading