From 747f2a9fa89b635827ee9e83549920ae5dedf955 Mon Sep 17 00:00:00 2001 From: uncor3 Date: Wed, 18 Feb 2026 22:15:34 +0000 Subject: [PATCH] update CMakeLists.txt --- CMakeLists.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 309ca92..e39dc30 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -97,6 +97,8 @@ message(STATUS "Using idevice-rs Rust implementation") set(IDEVICE_RS_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/lib/idevice-rs) set(IDEVICE_RS_LIB_PATH ${IDEVICE_RS_SOURCE_DIR}/target/debug/libidevice_ffi.a) +# FIXME: update env elsewhere so cargo gets detected +if(APPLE) add_custom_command( OUTPUT ${IDEVICE_RS_LIB_PATH} # Ensure rustc is visible in the build environment @@ -108,6 +110,16 @@ add_custom_command( COMMENT "Building idevice-rs FFI libraryy" VERBATIM ) +else() +add_custom_command( + OUTPUT ${IDEVICE_RS_LIB_PATH} + COMMAND ${CARGO_EXECUTABLE} build --manifest-path ${IDEVICE_RS_SOURCE_DIR}/Cargo.toml + WORKING_DIRECTORY ${IDEVICE_RS_SOURCE_DIR} + COMMENT "Building idevice-rs FFI libraryy" + VERBATIM +) +endif() + # This custom target provides a name to build the Rust library explicitly. # It depends on the output file, ensuring the custom command is run.