Skip to content

Commit daad271

Browse files
Sxian/clt 2506/fix release livekit version number (#45)
* use the request_async_id in cpp * changed the code back to always throw when ffi returns invalid result * fix the timeout issue and a few bugs related to the SimpleRoom example * update to the latest rust sdk commit with the audio thread fix * pass the release version to build scripts
1 parent af4e3e5 commit daad271

File tree

5 files changed

+66
-15
lines changed

5 files changed

+66
-15
lines changed

.github/workflows/make-release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,11 @@ jobs:
142142
if: runner.os == 'Windows'
143143
shell: pwsh
144144
run: |
145-
.\build.cmd release-examples
146-
147145
$version = "${{ steps.version.outputs.version }}"
148146
$bundleDir = "sdk-out/livekit-sdk-${{ matrix.name }}-$version"
149147
148+
.\build.cmd release-examples --version $version
149+
150150
# There is the missing step that generates LiveKitTargets.cmake in the install tree
151151
# TODO(sxian): fix it after getting access to a windows machine
152152
cmake --install "build-release" --config Release --prefix "$bundleDir"

build.cmd

Lines changed: 41 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ set "PROJECT_ROOT=%~dp0"
55
set "PROJECT_ROOT=%PROJECT_ROOT:~0,-1%"
66
set "BUILD_TYPE=Release"
77
set "PRESET=windows-release"
8+
set "LIVEKIT_VERSION="
9+
set "CMAKE_EXTRA_ARGS="
810

911
REM ============================================================
1012
REM Auto-detect LIBCLANG_PATH if not already set
@@ -55,42 +57,71 @@ if not defined LIBCLANG_PATH (
5557
)
5658

5759
if "%1"=="" goto usage
58-
if "%1"=="help" goto usage
60+
if /I "%1"=="help" goto usage
5961
if "%1"=="-h" goto usage
6062
if "%1"=="--help" goto usage
6163

62-
if "%1"=="debug" (
64+
set "CMD=%1"
65+
shift
66+
goto parse_args
67+
68+
:parse_args
69+
if "%1"=="" goto after_parse
70+
71+
if "%1"=="--version" (
72+
shift
73+
if "%1"=="" (
74+
echo ERROR: --version requires a value
75+
exit /b 1
76+
)
77+
set "LIVEKIT_VERSION=%1"
78+
shift
79+
goto parse_args
80+
)
81+
82+
echo ERROR: Unknown option: %1
83+
exit /b 1
84+
85+
:after_parse
86+
if defined LIVEKIT_VERSION (
87+
set "CMAKE_EXTRA_ARGS=-DLIVEKIT_VERSION=%LIVEKIT_VERSION%"
88+
echo ==^> Injecting LIVEKIT_VERSION=%LIVEKIT_VERSION%
89+
)
90+
goto dispatch
91+
92+
:dispatch
93+
if "%CMD%"=="debug" (
6394
set "BUILD_TYPE=Debug"
6495
set "PRESET=windows-debug"
6596
set "BUILD_DIR=%PROJECT_ROOT%\build-debug"
6697
goto configure_build
6798
)
6899

69-
if "%1"=="debug-examples" (
100+
if "%CMD%"=="debug-examples" (
70101
set "BUILD_TYPE=Debug"
71102
set "PRESET=windows-debug-examples"
72103
set "BUILD_DIR=%PROJECT_ROOT%\build-debug"
73104
goto configure_build
74105
)
75106

76-
if "%1"=="release" (
107+
if "%CMD%"=="release" (
77108
set "BUILD_TYPE=Release"
78109
set "PRESET=windows-release"
79110
set "BUILD_DIR=%PROJECT_ROOT%\build-release"
80111
goto configure_build
81112
)
82113

83-
if "%1"=="release-examples" (
114+
if "%CMD%"=="release-examples" (
84115
set "BUILD_TYPE=Release"
85116
set "PRESET=windows-release-examples"
86117
set "BUILD_DIR=%PROJECT_ROOT%\build-release"
87118
goto configure_build
88119
)
89120

90-
if "%1"=="clean" goto clean
91-
if "%1"=="clean-all" goto clean_all
121+
if "%CMD%"=="clean" goto clean
122+
if "%CMD%"=="clean-all" goto clean_all
92123

93-
echo Unknown command: %1
124+
echo Unknown command: %CMD%
94125
goto usage
95126

96127
:usage
@@ -117,9 +148,9 @@ goto :eof
117148
echo ==^> Configuring CMake (%BUILD_TYPE%)...
118149
if not defined VCPKG_ROOT (
119150
echo Warning: VCPKG_ROOT is not set. Attempting to configure without vcpkg...
120-
cmake -S . -B "%BUILD_DIR%" -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=%BUILD_TYPE%
151+
cmake -S . -B "%BUILD_DIR%" -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=%BUILD_TYPE% %CMAKE_EXTRA_ARGS%
121152
) else (
122-
cmake --preset %PRESET%
153+
cmake --preset "%PRESET%" %CMAKE_EXTRA_ARGS%
123154
)
124155
if errorlevel 1 (
125156
echo Configuration failed!

build.sh

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,21 @@ parse_opts() {
126126

127127
configure() {
128128
echo "==> Configuring CMake (${BUILD_TYPE}) using preset ${PRESET}..."
129-
if ! cmake --preset "${PRESET}"; then
130-
echo "Warning: CMake preset '${PRESET}' failed. Falling back to traditional configure..."
131-
cmake -S . -B "${BUILD_DIR}" -DCMAKE_BUILD_TYPE="${BUILD_TYPE}"
129+
local -a extra_args=()
130+
if [[ -n "${LIVEKIT_VERSION}" ]]; then
131+
echo "==> Injecting LIVEKIT_VERSION=${LIVEKIT_VERSION}"
132+
extra_args+=("-DLIVEKIT_VERSION=${LIVEKIT_VERSION}")
133+
fi
134+
if ((${#extra_args[@]})); then
135+
if ! cmake --preset "${PRESET}" "${extra_args[@]}"; then
136+
echo "Warning: CMake preset '${PRESET}' failed. Falling back to traditional configure..."
137+
cmake -S . -B "${BUILD_DIR}" -DCMAKE_BUILD_TYPE="${BUILD_TYPE}" "${extra_args[@]}"
138+
fi
139+
else
140+
if ! cmake --preset "${PRESET}"; then
141+
echo "Warning: CMake preset '${PRESET}' failed. Falling back to traditional configure..."
142+
cmake -S . -B "${BUILD_DIR}" -DCMAKE_BUILD_TYPE="${BUILD_TYPE}"
143+
fi
132144
fi
133145
}
134146

examples/simple_room/main.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,9 +233,16 @@ static std::vector<std::uint8_t> toBytes(const std::string &s) {
233233
return std::vector<std::uint8_t>(s.begin(), s.end());
234234
}
235235

236+
void print_livekit_version() {
237+
std::cout << "LiveKit version: " << LIVEKIT_BUILD_VERSION_FULL << " ("
238+
<< LIVEKIT_BUILD_FLAVOR << ", commit " << LIVEKIT_BUILD_COMMIT
239+
<< ", built " << LIVEKIT_BUILD_DATE << ")" << std::endl;
240+
}
241+
236242
} // namespace
237243

238244
int main(int argc, char *argv[]) {
245+
print_livekit_version();
239246
std::string url, token;
240247
bool enable_e2ee = false;
241248
std::string e2ee_key;

include/livekit/livekit.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include "audio_frame.h"
2020
#include "audio_source.h"
2121
#include "audio_stream.h"
22+
#include "build.h"
2223
#include "e2ee.h"
2324
#include "local_audio_track.h"
2425
#include "local_participant.h"

0 commit comments

Comments
 (0)