Skip to content

Commit ff6458e

Browse files
committed
feat: add examples building support to build scripts
- Add debug-examples and release-examples commands - Update usage help text
1 parent f03e3a0 commit ff6458e

File tree

3 files changed

+35
-1
lines changed

3 files changed

+35
-1
lines changed

build.cmd

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,24 @@ if "%1"=="debug" (
6767
goto configure_build
6868
)
6969

70+
if "%1"=="debug-examples" (
71+
set "BUILD_TYPE=Debug"
72+
set "PRESET=windows-debug-examples"
73+
goto configure_build
74+
)
75+
7076
if "%1"=="release" (
7177
set "BUILD_TYPE=Release"
7278
set "PRESET=windows-release"
7379
goto configure_build
7480
)
7581

82+
if "%1"=="release-examples" (
83+
set "BUILD_TYPE=Release"
84+
set "PRESET=windows-release-examples"
85+
goto configure_build
86+
)
87+
7688
if "%1"=="verbose" (
7789
set "VERBOSE=--verbose"
7890
goto build_only
@@ -89,7 +101,9 @@ echo Usage: build.cmd [command]
89101
echo.
90102
echo Commands:
91103
echo debug Configure + build Debug version
104+
echo debug-examples Configure + build Debug version with examples
92105
echo release Configure + build Release version
106+
echo release-examples Configure + build Release version with examples
93107
echo clean Run CMake's built-in clean target
94108
echo clean-all Run clean_all (clears C++ + Rust targets)
95109
echo verbose Build with verbose output (implies last configured type)
@@ -98,6 +112,7 @@ echo.
98112
echo Examples:
99113
echo build.cmd debug
100114
echo build.cmd release
115+
echo build.cmd release-examples
101116
echo build.cmd clean
102117
echo build.cmd clean-all
103118
echo build.cmd verbose

build.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ Usage: ./build.sh [command] [options]
2424
2525
Commands:
2626
debug Configure + build Debug version
27+
debug-examples Configure + build Debug version with examples
2728
release Configure + build Release version
29+
release-examples Configure + build Release version with examples
2830
clean Run CMake's built-in clean target
2931
clean-all Run clean_all (clears C++ + Rust targets)
3032
verbose Build with verbose output (implies last configured type)
@@ -33,6 +35,7 @@ Commands:
3335
Examples:
3436
./build.sh debug
3537
./build.sh release
38+
./build.sh release-examples
3639
./build.sh clean
3740
./build.sh clean-all
3841
./build.sh verbose
@@ -94,12 +97,24 @@ case "$1" in
9497
configure
9598
build
9699
;;
100+
debug-examples)
101+
BUILD_TYPE="Debug"
102+
PRESET="${OS_TYPE}-debug-examples"
103+
configure
104+
build
105+
;;
97106
release)
98107
BUILD_TYPE="Release"
99108
PRESET="${OS_TYPE}-release"
100109
configure
101110
build
102111
;;
112+
release-examples)
113+
BUILD_TYPE="Release"
114+
PRESET="${OS_TYPE}-release-examples"
115+
configure
116+
build
117+
;;
103118
verbose)
104119
VERBOSE="1"
105120
build

examples/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ include(sdl3)
1313
set(EXAMPLES_PRIVATE_INCLUDE_DIRS
1414
${LIVEKIT_ROOT_DIR}/src
1515
${LIVEKIT_BINARY_DIR}/generated
16-
${Protobuf_INCLUDE_DIRS}
1716
)
1817

1918
add_executable(SimpleRoom
@@ -32,9 +31,12 @@ add_executable(SimpleRoom
3231

3332
target_include_directories(SimpleRoom PRIVATE ${EXAMPLES_PRIVATE_INCLUDE_DIRS})
3433

34+
# Link protobuf::libprotobuf directly to get proper include directories
35+
# (livekit links it PRIVATELY so its headers aren't propagated)
3536
target_link_libraries(SimpleRoom
3637
PRIVATE
3738
livekit
39+
protobuf::libprotobuf
3840
SDL3::SDL3
3941
)
4042

@@ -64,6 +66,7 @@ target_link_libraries(SimpleRpc
6466
PRIVATE
6567
nlohmann_json::nlohmann_json
6668
livekit
69+
protobuf::libprotobuf
6770
)
6871

6972
add_executable(SimpleDataStream
@@ -75,6 +78,7 @@ target_include_directories(SimpleDataStream PRIVATE ${EXAMPLES_PRIVATE_INCLUDE_D
7578
target_link_libraries(SimpleDataStream
7679
PRIVATE
7780
livekit
81+
protobuf::libprotobuf
7882
)
7983

8084
add_custom_command(

0 commit comments

Comments
 (0)