@@ -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-
146136configure () {
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
191165detect_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
250201install_bundle () {
0 commit comments