Skip to content

Commit 00bb2af

Browse files
Additional cleanup
1 parent 6c8a3a9 commit 00bb2af

2 files changed

Lines changed: 0 additions & 81 deletions

File tree

build.cmd

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,6 @@ echo build.cmd clean-all
202202
goto :eof
203203

204204
:configure_build
205-
call :now _T_CONFIG_START
206205
echo ==^> Configuring CMake (%BUILD_TYPE%)...
207206
if not defined VCPKG_ROOT (
208207
echo Warning: VCPKG_ROOT is not set. Attempting to configure without vcpkg...
@@ -214,7 +213,6 @@ if errorlevel 1 (
214213
echo Configuration failed!
215214
exit /b 1
216215
)
217-
call :elapsed "configure (%PRESET%)" %_T_CONFIG_START%
218216
goto build_only
219217

220218
:build_only
@@ -227,45 +225,15 @@ if not defined BUILD_PARALLEL_JOBS (
227225
set "BUILD_PARALLEL_JOBS=2"
228226
)
229227
)
230-
call :now _T_BUILD_START
231228
echo ==^> Building (%BUILD_TYPE%) with %BUILD_PARALLEL_JOBS% parallel jobs...
232-
233-
rem Optional Rust-FFI-first split: build the build_rust_ffi target on its own
234-
rem first so CI logs report the Rust dep/FFI compile time separately from the
235-
rem C++ compile time. Off by default (single build invocation).
236-
if "%LK_BUILD_TIMING%"=="1" (
237-
call :now _T_FFI_START
238-
echo ==^> [timing] Building Rust FFI target ^(build_rust_ffi^) first...
239-
cmake --build "%BUILD_DIR%" --config %BUILD_TYPE% --parallel "%BUILD_PARALLEL_JOBS%" --target build_rust_ffi
240-
if errorlevel 1 (
241-
echo Build failed!
242-
exit /b 1
243-
)
244-
call :elapsed "build: Rust FFI (build_rust_ffi)" %_T_FFI_START%
245-
)
246-
247229
cmake --build "%BUILD_DIR%" --config %BUILD_TYPE% --parallel "%BUILD_PARALLEL_JOBS%"
248230
if errorlevel 1 (
249231
echo Build failed!
250232
exit /b 1
251233
)
252-
call :elapsed "build total (%PRESET%)" %_T_BUILD_START%
253234
echo ==^> Build complete!
254235
goto :eof
255236

256-
rem ---- timing helpers ----
257-
rem :now <varname> -> sets <varname> to current Unix epoch seconds.
258-
:now
259-
for /f %%s in ('powershell -NoProfile -Command "[int][double]::Parse((Get-Date -UFormat %%s))"') do set "%~1=%%s"
260-
goto :eof
261-
262-
rem :elapsed "<label>" <start-epoch> -> prints "==> [timing] <label>: <N>s".
263-
:elapsed
264-
call :now _T_ELAPSED_END
265-
set /a _T_ELAPSED_DIFF=%_T_ELAPSED_END% - %~2
266-
echo ==^> [timing] %~1: %_T_ELAPSED_DIFF%s
267-
goto :eof
268-
269237
:clean
270238
echo ==^> Cleaning build directories...
271239
set "BUILD_DIR_DEBUG=%PROJECT_ROOT%\build-debug"

build.sh

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -133,19 +133,7 @@ parse_opts() {
133133
done
134134
}
135135

136-
# Print "<label>: <N>s" using a start timestamp captured with `date +%s`.
137-
# Used for the build-phase timing breakdown surfaced in CI logs. Set
138-
# LK_BUILD_TIMING=1 to also split the Rust FFI build out from the C++ build.
139-
_lk_now() { date +%s; }
140-
_lk_report() {
141-
local label="$1" start="$2" end
142-
end="$(_lk_now)"
143-
echo "==> [timing] ${label}: $((end - start))s"
144-
}
145-
146136
configure() {
147-
local _t_start
148-
_t_start="$(_lk_now)"
149137
echo "==> Configuring CMake (${BUILD_TYPE}) using preset ${PRESET}..."
150138
local -a extra_args=()
151139
if [[ -n "${LIVEKIT_VERSION}" ]]; then
@@ -156,19 +144,6 @@ configure() {
156144
echo "==> Setting CMAKE_OSX_ARCHITECTURES=${MACOS_ARCH}"
157145
extra_args+=("-DCMAKE_OSX_ARCHITECTURES=${MACOS_ARCH}")
158146
fi
159-
# Bridge compiler-launcher env vars (e.g. sccache/ccache) into the CMake
160-
# cache. CMake does NOT read CMAKE_<LANG>_COMPILER_LAUNCHER from the
161-
# environment, so CI exports these and we forward them explicitly. Only the
162-
# Ninja/Makefile generators honor launchers; the Visual Studio generator
163-
# ignores them, so Windows builds simply leave these unset.
164-
if [[ -n "${CMAKE_C_COMPILER_LAUNCHER:-}" ]]; then
165-
echo "==> Using C compiler launcher: ${CMAKE_C_COMPILER_LAUNCHER}"
166-
extra_args+=("-DCMAKE_C_COMPILER_LAUNCHER=${CMAKE_C_COMPILER_LAUNCHER}")
167-
fi
168-
if [[ -n "${CMAKE_CXX_COMPILER_LAUNCHER:-}" ]]; then
169-
echo "==> Using C++ compiler launcher: ${CMAKE_CXX_COMPILER_LAUNCHER}"
170-
extra_args+=("-DCMAKE_CXX_COMPILER_LAUNCHER=${CMAKE_CXX_COMPILER_LAUNCHER}")
171-
fi
172147
if ((${#extra_args[@]})); then
173148
if ! cmake --preset "${PRESET}" "${extra_args[@]}"; then
174149
echo "Warning: CMake preset '${PRESET}' failed. Falling back to traditional configure..."
@@ -185,7 +160,6 @@ configure() {
185160
ln -sf "${BUILD_DIR}/compile_commands.json" "${PROJECT_ROOT}/compile_commands.json"
186161
echo "==> Symlinked compile_commands.json -> ${BUILD_DIR}/compile_commands.json"
187162
fi
188-
_lk_report "configure (${PRESET})" "${_t_start}"
189163
}
190164

191165
detect_parallel_jobs() {
@@ -214,37 +188,14 @@ build() {
214188
local parallel_jobs
215189
parallel_jobs="$(detect_parallel_jobs)"
216190

217-
local _t_start _t_ffi
218-
_t_start="$(_lk_now)"
219-
220191
echo "==> Building (${BUILD_TYPE}) with ${parallel_jobs} parallel jobs..."
221-
local have_preset=0
222192
if [[ -n "${PRESET}" ]] && [[ -f "${PROJECT_ROOT}/CMakePresets.json" ]]; then
223-
have_preset=1
224-
fi
225-
226-
# Optional Rust-FFI-first split: build the build_rust_ffi target on its own
227-
# first so CI logs report the Rust dep/FFI compile time separately from the
228-
# C++ compile time. Off by default (single build invocation).
229-
if [[ "${LK_BUILD_TIMING:-0}" == "1" ]]; then
230-
_t_ffi="$(_lk_now)"
231-
echo "==> [timing] Building Rust FFI target (build_rust_ffi) first..."
232-
if [[ "${have_preset}" -eq 1 ]]; then
233-
cmake --build --preset "${PRESET}" --parallel "${parallel_jobs}" --target build_rust_ffi
234-
else
235-
cmake --build "${BUILD_DIR}" --parallel "${parallel_jobs}" --target build_rust_ffi
236-
fi
237-
_lk_report "build: Rust FFI (build_rust_ffi)" "${_t_ffi}"
238-
fi
239-
240-
if [[ "${have_preset}" -eq 1 ]]; then
241193
# Use preset build if available
242194
cmake --build --preset "${PRESET}" --parallel "${parallel_jobs}"
243195
else
244196
# Fallback to traditional build
245197
cmake --build "${BUILD_DIR}" --parallel "${parallel_jobs}"
246198
fi
247-
_lk_report "build total (${PRESET})" "${_t_start}"
248199
}
249200

250201
install_bundle() {

0 commit comments

Comments
 (0)