Skip to content
Merged
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
32 changes: 20 additions & 12 deletions .github/workflows/builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,32 +34,32 @@ jobs:
include:
- os: ubuntu-22.04
name: ubuntu-22.04-x64
build_cmd: ./build.sh release-examples
build_cmd: ./build.sh release-examples --bundle --prefix sdk-out/livekit-sdk-ubuntu-22.04-x64
build_dir: build-release
- os: ubuntu-22.04-arm
name: ubuntu-22.04-arm64
build_cmd: ./build.sh release-examples
build_cmd: ./build.sh release-examples --bundle --prefix sdk-out/livekit-sdk-ubuntu-22.04-arm64
build_dir: build-release
- os: ubuntu-24.04
name: ubuntu-24.04-x64
build_cmd: ./build.sh release-examples
build_cmd: ./build.sh release-examples --bundle --prefix sdk-out/livekit-sdk-ubuntu-24.04-x64
build_dir: build-release
- os: ubuntu-24.04-arm
name: ubuntu-24.04-arm64
build_cmd: ./build.sh release-examples
build_cmd: ./build.sh release-examples --bundle --prefix sdk-out/livekit-sdk-ubuntu-24.04-arm64
build_dir: build-release
- os: macos-26-xlarge
name: macos-arm64
build_cmd: ./build.sh release-examples
build_cmd: ./build.sh release-examples --bundle --prefix sdk-out/livekit-sdk-macos-arm64
build_dir: build-release
- os: macos-26-large
name: macos-x64
build_cmd: ./build.sh release-examples --macos-arch x86_64
build_cmd: ./build.sh release-examples --bundle --prefix sdk-out/livekit-sdk-macos-x64 --macos-arch x86_64
build_dir: build-release
# Pinned to Windows 2022 for current VS 17 implementation
- os: windows-2022
name: windows-x64
build_cmd: .\build.cmd release-examples
build_cmd: .\build.cmd release-examples --bundle --prefix sdk-out\livekit-sdk-windows-x64
build_dir: build-release

name: Build (${{ matrix.name }})
Expand Down Expand Up @@ -325,15 +325,23 @@ jobs:
}
if ($failed) { exit 1 } else { exit 0 }

- name: Verify SDK bundle

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might be overkill, open to removing

shell: bash
run: |
set -euo pipefail
bundle="sdk-out/livekit-sdk-${{ matrix.name }}"
test -f "${bundle}/include/livekit/livekit.h"
test -f "${bundle}/share/livekit/build-info.json"
test -f "${bundle}/lib/cmake/LiveKit/LiveKitConfig.cmake"
test -f "${bundle}/lib/cmake/LiveKit/LiveKitConfigVersion.cmake"
test -f "${bundle}/lib/cmake/LiveKit/LiveKitTargets.cmake"

# ---------- Upload artifacts ----------
- name: Upload build artifacts
- name: Upload SDK bundle
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: livekit-sdk-${{ matrix.name }}
path: |
${{ matrix.build_dir }}/lib/
${{ matrix.build_dir }}/include/
${{ matrix.build_dir }}/bin/
path: sdk-out/livekit-sdk-${{ matrix.name }}
retention-days: 7

- name: Upload deprecated linux-x64 alias artifact
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/make-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -248,11 +248,7 @@ jobs:
$bundleDir = "sdk-out/livekit-sdk-${{ matrix.name }}-$version"

if ([string]::IsNullOrWhiteSpace($version)) { throw "version is empty" }
.\build.cmd release-examples --version "$version"

# There is the missing step that generates LiveKitTargets.cmake in the install tree
# TODO(sxian): fix it after getting access to a windows machine
cmake --install "build-release" --config Release --prefix "$bundleDir"
.\build.cmd release-examples --version "$version" --bundle --prefix "$bundleDir"
Comment thread
alan-george-lk marked this conversation as resolved.

Write-Host "Bundle contents:"
Get-ChildItem -Recurse -File $bundleDir | Select-Object -First 200 | ForEach-Object { $_.FullName }
Expand Down
7 changes: 6 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ Be sure to update the directory layout in this file if the directory layout chan

## Build
for building, use the build.sh script for Linux and macOS, and the build.cmd script for Windows. Do not invoke CMake directly to build the SDK.
Updates to ./build.sh and ./build.cmd should be accompanied by updates to this file and the README.md file.
Updates to ./build.sh and ./build.cmd should be accompanied by updates to this file and docs/building.md.

```
./build.sh debug # Debug build
Expand All @@ -122,6 +122,11 @@ Updates to ./build.sh and ./build.cmd should be accompanied by updates to this f
./build.sh clean-all # Full clean (C++ + local-install + Rust targets)
```

To create an installable SDK bundle, use the same build command with
`--bundle --prefix <install-dir>` (for example,
`./build.sh release --bundle --prefix sdk-out/livekit-sdk`). On Windows, use
`build.cmd release --bundle --prefix C:\path\to\livekit-sdk`.

The build scripts pass an explicit job count to `cmake --build --parallel`. Set
`CMAKE_BUILD_PARALLEL_LEVEL` to override the default detected logical CPU count.

Expand Down
60 changes: 59 additions & 1 deletion build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ set "PRESET=windows-release"
set "LIVEKIT_VERSION="
set "CMAKE_EXTRA_ARGS="
set "BUILD_PARALLEL_JOBS="
set "DO_BUNDLE="
set "PREFIX="

REM ============================================================
REM Auto-detect LIBCLANG_PATH if not already set
Expand Down Expand Up @@ -87,7 +89,20 @@ if /I "%~1"=="--version" (
goto :get_version_value
)

:: 3. Handle unknown arguments
:: 3. Install the SDK bundle after a successful build.
if /I "%~1"=="--bundle" (
set "DO_BUNDLE=1"
shift
goto parse_all
)

:: 4. Set the install prefix for --bundle.
if /I "%~1"=="--prefix" (
shift
goto :get_prefix_value
)
Comment thread
devin-ai-integration[bot] marked this conversation as resolved.

:: 5. Handle unknown arguments
echo ERROR: Unknown option: %~1
exit /b 1

Expand All @@ -97,6 +112,15 @@ set "LIVEKIT_VERSION=%~1"
shift
goto parse_all

:get_prefix_value
if "%~1"=="" (
echo ERROR: --prefix requires a value
exit /b 1
)
set "PREFIX=%~1"
shift
goto parse_all

:after_parse
if not defined CMD (
echo ERROR: No command specified
Expand Down Expand Up @@ -190,10 +214,15 @@ echo clean Clean both Debug and Release build directories + local-
echo clean-all Full clean (build dirs + local-install + Rust targets)
echo help Show this help
echo.
echo Options (for debug / release):
echo --bundle Install the SDK bundle using cmake --install
echo --prefix ^<dir^> Install prefix for --bundle ^(default: .\sdk-out\livekit-sdk^)
echo.
echo Examples:
echo build.cmd debug
echo build.cmd release
echo build.cmd release-examples
echo build.cmd release --bundle --prefix C:\path\to\livekit-sdk
echo build.cmd debug-tests
echo build.cmd release-tests
echo build.cmd release-all
Expand Down Expand Up @@ -232,8 +261,37 @@ if errorlevel 1 (
exit /b 1
)
echo ==^> Build complete!
if defined DO_BUNDLE (
call :install_bundle
if errorlevel 1 exit /b 1
)
goto :eof

:install_bundle
if not defined PREFIX set "PREFIX=%PROJECT_ROOT%\sdk-out\livekit-sdk"

if not "%PREFIX:~1,1%"==":" set "PREFIX=%PROJECT_ROOT%\%PREFIX%"

REM cmd's mkdir/rmdir reject forward slashes; normalize to backslashes.
set "PREFIX=%PREFIX:/=\%"

echo ==^> Installing SDK bundle to: %PREFIX%
if exist "%PREFIX%" rmdir /s /q "%PREFIX%"
if exist "%PREFIX%" (
echo Failed to remove existing bundle directory: %PREFIX%
exit /b 1
)
mkdir "%PREFIX%"
Comment thread
alan-george-lk marked this conversation as resolved.
if errorlevel 1 exit /b 1

cmake --install "%BUILD_DIR%" --config %BUILD_TYPE% --prefix "%PREFIX%"
if errorlevel 1 (
echo SDK bundle install failed!
exit /b 1
)
echo ==^> SDK bundle installed.
exit /b 0

:clean
echo ==^> Cleaning build directories...
set "BUILD_DIR_DEBUG=%PROJECT_ROOT%\build-debug"
Expand Down
17 changes: 17 additions & 0 deletions docs/building.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,23 @@ wrap the right CMake preset for your platform and pick sensible defaults.
# ... same suffixes as build.sh
```

### Create an SDK bundle

To create an installable SDK bundle with public headers, runtime libraries, and
CMake package files, add `--bundle --prefix <install-dir>` to a build command:

**Linux/Mac:**

```bash
./build.sh release --bundle --prefix sdk-out/livekit-sdk
```

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe add "linux/mac:" before the bash example and a "windows:" before the powershell example since it is possible to run poweshell on linux

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call, added

**Windows:**

```powershell
.\build.cmd release --bundle --prefix C:\path\to\livekit-sdk
```

The build scripts pass an explicit job count to `cmake --build --parallel`. Set
`CMAKE_BUILD_PARALLEL_LEVEL` to override the auto-detected logical CPU count.

Expand Down
Loading