Skip to content

Commit b825ab5

Browse files
Wrap dependencies into building.md, fix discrepancies (#243)
1 parent 1d229ba commit b825ab5

2 files changed

Lines changed: 48 additions & 313 deletions

File tree

‎DEPENDENCIES.md‎

Lines changed: 0 additions & 259 deletions
This file was deleted.

‎docs/building.md‎

Lines changed: 48 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -215,15 +215,18 @@ After a successful build:
215215
```
216216
build-release/
217217
├── lib/
218-
│ ├── liblivekit.{a,lib} # Main SDK static library
219-
│ ├── liblivekit_ffi.{so,dylib} # Rust FFI dynamic library
220-
│ └── livekit_ffi.dll, *.lib # (Windows) FFI DLL + import lib
218+
│ ├── liblivekit.{so,dylib} # Main SDK shared library (Linux/macOS)
219+
│ ├── liblivekit_ffi.{so,dylib} # Rust FFI shared library (Linux/macOS)
220+
│ └── livekit{,_ffi}.lib # Import libraries (Windows)
221221
├── include/ # Public headers (auto-synced)
222222
│ └── livekit/
223-
└── bin/ # Example/test executables
224-
└── liblivekit_ffi.{so,dylib} # (Linux/macOS: copied for runtime)
223+
└── bin/
224+
└── livekit{,_ffi}.dll # SDK DLLs (Windows)
225225
```
226226

227+
Release archives use the same layout: `include/`, `lib/`, and (on Windows)
228+
`bin/`. The exact build-tree layout can vary with the CMake generator.
229+
227230
## Integrating into your project
228231

229232
### Using CMake
@@ -234,8 +237,8 @@ add_subdirectory(path/to/client-sdk-cpp)
234237
target_link_libraries(your_target PRIVATE livekit)
235238
236239
# Method 2: find_package (after install)
237-
find_package(livekit REQUIRED)
238-
target_link_libraries(your_target PRIVATE livekit)
240+
find_package(LiveKit CONFIG REQUIRED)
241+
target_link_libraries(your_target PRIVATE LiveKit::livekit)
239242
```
240243

241244
### Using prebuilt releases
@@ -252,53 +255,44 @@ See the example collection's
252255
[`LiveKitSDK.cmake`](https://github.com/livekit-examples/cpp-example-collection/blob/main/cmake/LiveKitSDK.cmake)
253256
for the full pattern.
254257

255-
### Manual linking
256-
257-
1. Add include path: `build-release/include`
258-
2. Link the static SDK library:
259-
- Windows: `build-release/lib/livekit.lib`
260-
- Linux: `build-release/lib/liblivekit.a`
261-
- macOS: `build-release/lib/liblivekit.a`
262-
3. Link/deploy the Rust FFI dynamic library:
263-
- Windows: link `livekit_ffi.dll.lib`, deploy `livekit_ffi.dll` next to your `.exe`
264-
- Linux: deploy `liblivekit_ffi.so` next to your executable
265-
- macOS: deploy `liblivekit_ffi.dylib` next to your executable
266-
4. Link platform system libraries (see below).
267-
268-
> **Important:** On Linux/macOS the FFI shared library must live next to the
269-
> executable. RPATH is set to `$ORIGIN` (Linux) / `@loader_path` (macOS).
270-
271-
**Windows system libraries:**
272-
```
273-
ntdll userenv winmm iphlpapi msdmo dmoguids wmcodecdspuuid
274-
ws2_32 secur32 bcrypt crypt32
275-
```
276-
277-
**macOS frameworks:**
278-
```
279-
CoreAudio AudioToolbox CoreFoundation Security CoreGraphics
280-
CoreMedia VideoToolbox AVFoundation CoreVideo Foundation
281-
AppKit QuartzCore OpenGL IOSurface Metal MetalKit ScreenCaptureKit
282-
```
283-
284-
**Linux libraries:**
285-
```
286-
OpenSSL::SSL OpenSSL::Crypto
287-
```
288-
289-
### Runtime dependencies of prebuilt artifacts
290-
291-
Whether protobuf / abseil / openssl need to be installed on the target
292-
machine depends on how the SDK binary was built:
293-
294-
- **Windows** release artifacts use vcpkg triplet `x64-windows-static-md` —
295-
protobuf and abseil are statically linked into the DLLs; no runtime install
296-
needed.
297-
- **macOS** release artifacts (from our CI) do **not** dynamically depend on
298-
protobuf / abseil / openssl. You can verify with `otool -L liblivekit.dylib`.
299-
- **Linux** depends on packaging. Check with `ldd liblivekit_ffi.so`; if any
300-
of those are listed, install the corresponding `-dev` (build) or runtime
301-
package (`libprotobuf32` / `libabsl` / `libssl3`) as appropriate.
258+
### Manual linking and deployment
259+
260+
Prefer the CMake package above. It provides the correct include directory and
261+
the `LiveKit::livekit` shared-library target. If you link a release archive
262+
manually, add its `include/` directory and link only the main SDK library:
263+
264+
| Platform | Link-time file | Runtime files to deploy |
265+
|----------|----------------|-------------------------|
266+
| Windows | `lib/livekit.lib` | `bin/livekit.dll` and `bin/livekit_ffi.dll` beside the application executable |
267+
| Linux | `lib/liblivekit.so` | `liblivekit.so` and `liblivekit_ffi.so` in the same runtime-library directory |
268+
| macOS | `lib/liblivekit.dylib` | `liblivekit.dylib` and `liblivekit_ffi.dylib` in the same runtime-library directory |
269+
270+
Do not link the Rust FFI library directly: `livekit` already records it as a
271+
shared-library dependency. On Linux, `liblivekit.so` uses a `$ORIGIN` runpath
272+
to locate `liblivekit_ffi.so` next to it. On macOS, it uses `@loader_path` for
273+
the same purpose. Your application must still be configured to find
274+
`liblivekit` at runtime (for example, by using an appropriate executable
275+
RPATH or platform packaging mechanism).
276+
277+
### Runtime dependencies of release artifacts
278+
279+
Official release archives bundle the two SDK libraries above. They do not
280+
bundle, or dynamically depend on, Protobuf, Abseil, or OpenSSL. As of v1.7.0:
281+
282+
- **Windows:** the SDK DLLs depend on Windows system libraries and the
283+
Microsoft Visual C++ runtime. Install the supported Visual C++ Redistributable
284+
with your application when it is not already present. The archive contains no
285+
Protobuf or Abseil DLLs.
286+
- **Linux:** `liblivekit.so` additionally depends on the system C++ runtime,
287+
glibc, and `libcurl.so.4`; `liblivekit_ffi.so` depends on the system C++
288+
runtime and glibc. Install the matching runtime packages for your target
289+
distribution.
290+
- **macOS:** the SDK depends on system frameworks and the system `libcurl`;
291+
no Homebrew Protobuf, Abseil, or OpenSSL runtime is required.
292+
293+
These are release-artifact requirements, not source-build prerequisites. For
294+
an updated audit of a specific release, inspect its binaries with `ldd`
295+
(Linux), `otool -L` (macOS), or `dumpbin /dependents` (Windows).
302296

303297
## Troubleshooting
304298

0 commit comments

Comments
 (0)