File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -268,6 +268,10 @@ execute_process(
268268if(rv)
269269 message(FATAL_ERROR \" cargo build failed with code: \$ {rv}\" )
270270endif()
271+
272+ if(DEFINED EXPECTED_OUTPUT AND NOT EXPECTED_OUTPUT STREQUAL \"\" AND NOT EXISTS \"\$ {EXPECTED_OUTPUT}\" )
273+ message(FATAL_ERROR \" cargo build completed but did not produce expected Rust FFI artifact: \$ {EXPECTED_OUTPUT}\" )
274+ endif()
271275" )
272276
273277# Use SHARED library (DLL) on Windows to isolate /MT CRT from consuming /MD apps
@@ -335,23 +339,25 @@ file(GLOB_RECURSE RUST_SOURCES
335339)
336340
337341add_custom_command (
338- OUTPUT "${RUST_LIB_DEBUG} " " ${RUST_LIB_RELEASE} "
342+ OUTPUT "${LIVEKIT_BINARY_DIR } /rust_ffi_$< CONFIG >.stamp "
339343 COMMAND "${CMAKE_COMMAND } "
340344 -DCFG=$<CONFIG>
341345 -DRUST_ROOT=${RUST_ROOT}
342346 -DCARGO=${CARGO_EXECUTABLE}
343347 -DPROTOC_PATH=${Protobuf_PROTOC_EXECUTABLE}
344348 -DRUST_TARGET=${RUST_TARGET_TRIPLE}
345349 -DGCC_LIB_DIR=${GCC_LIB_DIR}
350+ -DEXPECTED_OUTPUT=$<IF:$<CONFIG:Debug>,${RUST_LIB_DEBUG},${RUST_LIB_RELEASE}>
346351 -P "${RUN_CARGO_SCRIPT} "
352+ COMMAND "${CMAKE_COMMAND } " -E touch "${LIVEKIT_BINARY_DIR } /rust_ffi_$<CONFIG >.stamp"
347353 WORKING_DIRECTORY "${RUST_ROOT} "
348354 DEPENDS ${RUST_SOURCES}
349355 COMMENT "Building Rust FFI via cargo"
350356 VERBATIM
351357)
352358
353359add_custom_target (build_rust_ffi
354- DEPENDS "${RUST_LIB_DEBUG} " " ${RUST_LIB_RELEASE} "
360+ DEPENDS "${LIVEKIT_BINARY_DIR } /rust_ffi_$< CONFIG >.stamp "
355361)
356362
357363# Note: protozero_plugin.o removal is no longer needed since we use dynamic libraries on Unix
You can’t perform that action at this time.
0 commit comments