Move all examples to cpp-example-collection#83
Move all examples to cpp-example-collection#83stephen-derosa wants to merge 2 commits intolivekit:mainfrom
Conversation
843693f to
c5c399a
Compare
There was a problem hiding this comment.
Pull request overview
This PR removes the in-repo examples/ tree and replaces it with a cpp-example-collection git submodule, integrating its build into the main SDK build when LIVEKIT_BUILD_EXAMPLES is enabled.
Changes:
- Deleted all existing
examples/**sources and theexamples/CMakeLists.txtbuild. - Added a new
cpp-example-collectionsubmodule and a CMake integration helper to configure/build it. - Updated top-level CMake and gitignore to support the new examples workflow.
Reviewed changes
Copilot reviewed 50 out of 51 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| examples/tokens/set_integration_test_tokens.bash | Removed token helper script as part of examples migration. |
| examples/tokens/README.md | Removed token examples README as part of examples migration. |
| examples/tokens/gen_and_set.bash | Removed token generation script as part of examples migration. |
| examples/simple_rpc/README.md | Removed SimpleRpc technical README as part of examples migration. |
| examples/simple_rpc/main.cpp | Removed SimpleRpc example source as part of examples migration. |
| examples/simple_room/main.cpp | Removed SimpleRoom example source as part of examples migration. |
| examples/simple_room/fallback_capture.h | Removed SimpleRoom fallback capture header as part of examples migration. |
| examples/simple_room/fallback_capture.cpp | Removed SimpleRoom fallback capture implementation as part of examples migration. |
| examples/simple_joystick/utils.h | Removed joystick example utility header as part of examples migration. |
| examples/simple_joystick/utils.cpp | Removed joystick example utility implementation as part of examples migration. |
| examples/simple_joystick/sender.cpp | Removed joystick sender example as part of examples migration. |
| examples/simple_joystick/receiver.cpp | Removed joystick receiver example as part of examples migration. |
| examples/simple_joystick/json_utils.h | Removed joystick JSON utilities header as part of examples migration. |
| examples/simple_joystick/json_utils.cpp | Removed joystick JSON utilities implementation as part of examples migration. |
| examples/simple_data_stream/main.cpp | Removed SimpleDataStream example source as part of examples migration. |
| examples/ping_pong/utils.h | Removed ping/pong example utilities as part of examples migration. |
| examples/ping_pong/pong.cpp | Removed pong participant example as part of examples migration. |
| examples/ping_pong/ping.cpp | Removed ping participant example as part of examples migration. |
| examples/ping_pong/messages.h | Removed ping/pong message definitions as part of examples migration. |
| examples/ping_pong/json_converters.h | Removed ping/pong JSON converter header as part of examples migration. |
| examples/ping_pong/json_converters.cpp | Removed ping/pong JSON converter implementation as part of examples migration. |
| examples/ping_pong/constants.h | Removed ping/pong constants as part of examples migration. |
| examples/logging_levels/README.md | Removed logging-levels README as part of examples migration. |
| examples/logging_levels/custom_sinks.cpp | Removed custom sinks logging example as part of examples migration. |
| examples/logging_levels/basic_usage.cpp | Removed basic logging usage example as part of examples migration. |
| examples/hello_livekit/sender.cpp | Removed HelloLivekit sender example as part of examples migration. |
| examples/hello_livekit/receiver.cpp | Removed HelloLivekit receiver example as part of examples migration. |
| examples/common/wav_audio_source.h | Removed shared WAV source helper as part of examples migration. |
| examples/common/wav_audio_source.cpp | Removed shared WAV source helper implementation as part of examples migration. |
| examples/common/sdl_video_renderer.h | Removed shared SDL renderer helper as part of examples migration. |
| examples/common/sdl_video_renderer.cpp | Removed shared SDL renderer helper implementation as part of examples migration. |
| examples/common/sdl_media.h | Removed shared SDL media helper as part of examples migration. |
| examples/common/sdl_media.cpp | Removed shared SDL media helper implementation as part of examples migration. |
| examples/common/sdl_media_manager.h | Removed shared SDL media manager header as part of examples migration. |
| examples/common/sdl_media_manager.cpp | Removed shared SDL media manager implementation as part of examples migration. |
| examples/CMakeLists.txt | Removed examples build definition as part of examples migration. |
| examples/cmake/sdl3.cmake | Removed SDL3 FetchContent helper used by in-tree examples. |
| examples/bridge_rpc/README.md | Removed bridge RPC example docs as part of examples migration. |
| examples/bridge_rpc/custom_receiver.cpp | Removed bridge RPC receiver example as part of examples migration. |
| examples/bridge_rpc/custom_caller.cpp | Removed bridge RPC caller example as part of examples migration. |
| examples/bridge_mute_unmute/receiver.cpp | Removed bridge mute/unmute receiver example as part of examples migration. |
| examples/bridge_mute_unmute/README.md | Removed bridge mute/unmute docs as part of examples migration. |
| examples/bridge_mute_unmute/caller.cpp | Removed bridge mute/unmute caller example as part of examples migration. |
| examples/bridge_human_robot/robot.cpp | Removed bridge human/robot robot example as part of examples migration. |
| examples/bridge_human_robot/human.cpp | Removed bridge human/robot human example as part of examples migration. |
| CMakeLists.txt | Switched examples build from add_subdirectory(examples) to cpp-example-collection integration. |
| cmake/cpp-example-collection.cmake | Added helper to install SDK then configure/build the cpp-example-collection submodule. |
| .gitmodules | Added cpp-example-collection submodule entry. |
| .gitignore | Ignored local-install/ used by the new examples build flow. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| add_custom_target(install_livekit_sdk_for_examples | ||
| COMMAND ${CMAKE_COMMAND} -E make_directory "${LIVEKIT_CPP_EXAMPLES_INSTALL_PREFIX}" | ||
| COMMAND ${CMAKE_COMMAND} --install "${CMAKE_BINARY_DIR}" | ||
| --prefix "${LIVEKIT_CPP_EXAMPLES_INSTALL_PREFIX}" | ||
| --config "$<CONFIG>" | ||
| DEPENDS livekit | ||
| COMMENT "Installing LiveKit SDK for cpp-example-collection" | ||
| VERBATIM | ||
| ) | ||
|
|
||
| add_custom_target(cpp_example_collection ALL | ||
| COMMAND ${CMAKE_COMMAND} -S "${LIVEKIT_CPP_EXAMPLES_SOURCE_DIR}" | ||
| -B "${LIVEKIT_CPP_EXAMPLES_BINARY_DIR}" | ||
| -DCMAKE_PREFIX_PATH="${LIVEKIT_CPP_EXAMPLES_INSTALL_PREFIX}" | ||
| -DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE}" | ||
| -DLiveKit_DIR="${LIVEKIT_CPP_EXAMPLES_LIVEKIT_DIR}" | ||
| COMMAND ${CMAKE_COMMAND} --build "${LIVEKIT_CPP_EXAMPLES_BINARY_DIR}" | ||
| --config "$<CONFIG>" | ||
| DEPENDS install_livekit_sdk_for_examples | ||
| COMMENT "Configuring and building cpp-example-collection" | ||
| VERBATIM | ||
| ) |
There was a problem hiding this comment.
Both install_livekit_sdk_for_examples and cpp_example_collection are custom targets with no declared OUTPUT/BYPRODUCTS. CMake generators treat these as always-out-of-date, so enabling LIVEKIT_BUILD_EXAMPLES will re-run the install + external configure/build steps on every build invocation. Consider switching to ExternalProject_Add or using stamp files via add_custom_command(OUTPUT ...) so these steps are incremental and only re-run when inputs change.
No description provided.