@@ -24,6 +24,13 @@ endif()
2424list (APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR} /cmake" )
2525include (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+
2734add_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)
4252target_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
101113add_executable (SimpleDataStream
@@ -107,6 +119,7 @@ target_include_directories(SimpleDataStream PRIVATE ${EXAMPLES_PRIVATE_INCLUDE_D
107119target_link_libraries (SimpleDataStream
108120 PRIVATE
109121 livekit
122+ protobuf::libprotobuf
110123)
111124
112125add_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