Skip to content

Commit 62bec56

Browse files
Revert "remove protobuf from the deps of examples (#27)"
This reverts commit 94bc274.
1 parent 94bc274 commit 62bec56

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ This SDK enables native C++ applications to connect to LiveKit servers for real-
1515

1616
### For Building the SDK:
1717
- **Windows:** Visual Studio 2019+, vcpkg
18-
- **Linux:** `sudo apt install ninja-build libprotobuf-dev libssl-dev` (protobuf 3.x)
19-
- **macOS:** `brew install ninja protobuf` (protobuf 3.x)
18+
- **Linux:** `sudo apt install libprotobuf-dev libssl-dev` (protobuf 3.x)
19+
- **macOS:** `brew install protobuf` (protobuf 3.x)
2020

2121
### For Using the Pre-built SDK:
2222
- **Windows:** ✅ All dependencies included (DLLs bundled) - ready to use

examples/CMakeLists.txt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@ endif()
2424
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
2525
include(sdl3)
2626

27+
# Common include directories for examples that need private headers
28+
# TODO: These should be refactored to use only public headers
29+
set(EXAMPLES_PRIVATE_INCLUDE_DIRS
30+
${LIVEKIT_ROOT_DIR}/src
31+
${LIVEKIT_BINARY_DIR}/generated
32+
)
33+
2734
add_executable(SimpleRoom
2835
simple_room/main.cpp
2936
simple_room/fallback_capture.cpp
@@ -38,10 +45,14 @@ add_executable(SimpleRoom
3845
simple_room/wav_audio_source.h
3946
)
4047

48+
target_include_directories(SimpleRoom PRIVATE ${EXAMPLES_PRIVATE_INCLUDE_DIRS})
4149

50+
# Link protobuf::libprotobuf directly to get proper include directories
51+
# (livekit links it PRIVATELY so its headers aren't propagated)
4252
target_link_libraries(SimpleRoom
4353
PRIVATE
4454
livekit
55+
protobuf::libprotobuf
4556
SDL3::SDL3
4657
)
4758

@@ -96,6 +107,7 @@ target_link_libraries(SimpleRpc
96107
PRIVATE
97108
nlohmann_json::nlohmann_json
98109
livekit
110+
protobuf::libprotobuf
99111
)
100112

101113
add_executable(SimpleDataStream
@@ -107,6 +119,7 @@ target_include_directories(SimpleDataStream PRIVATE ${EXAMPLES_PRIVATE_INCLUDE_D
107119
target_link_libraries(SimpleDataStream
108120
PRIVATE
109121
livekit
122+
protobuf::libprotobuf
110123
)
111124

112125
add_custom_command(
@@ -122,9 +135,13 @@ if(WIN32)
122135
# Get the livekit library output directory (where DLLs are copied during main build)
123136
set(LIVEKIT_LIB_DIR $<TARGET_FILE_DIR:livekit>)
124137

138+
# Protobuf DLL name depends on configuration (libprotobufd.dll for Debug, libprotobuf.dll for Release)
139+
set(PROTOBUF_DLL_NAME $<IF:$<CONFIG:Debug>,libprotobufd.dll,libprotobuf.dll>)
140+
125141
# List of DLLs to copy (using generator expressions for config-dependent names)
126142
set(REQUIRED_DLLS
127143
"livekit_ffi.dll"
144+
"${PROTOBUF_DLL_NAME}"
128145
"abseil_dll.dll"
129146
)
130147

0 commit comments

Comments
 (0)