@@ -266,14 +266,20 @@ if (viam_rust_utils_files)
266266 ${viam_rust_utils_file}
267267 ONLY_IF_DIFFERENT
268268 )
269- elseif (NOT WIN32 ) # TODO(RSDK-10366): Currently, rust_utils is not published for windows, so don't even try downloading
269+ elseif (NOT WIN32 OR ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "AMD64" )
270270 set (lvru_system_name ${CMAKE_SYSTEM_NAME} )
271271 if (CMAKE_SYSTEM_NAME STREQUAL "Darwin" )
272272 set (lvru_system_name "macosx" )
273273 endif ()
274+
275+ set (lvru_system_processor ${CMAKE_SYSTEM_PROCESSOR} )
276+ if (WIN32 )
277+ set (lvru_system_processor "x86_64" )
278+ endif ()
279+
274280 file (
275281 DOWNLOAD
276- https://github.com/viamrobotics/rust-utils/releases/latest/download/${CMAKE_SHARED_LIBRARY_PREFIX} viam_rust_utils-${lvru_system_name} _${CMAKE_SYSTEM_PROCESSOR }${CMAKE_STATIC_LIBRARY_SUFFIX}
282+ https://github.com/viamrobotics/rust-utils/releases/latest/download/${CMAKE_SHARED_LIBRARY_PREFIX} viam_rust_utils-${lvru_system_name} _${lvru_system_processor }${CMAKE_STATIC_LIBRARY_SUFFIX}
277283 ${viam_rust_utils_file}
278284 STATUS lvru_status
279285 )
@@ -283,24 +289,21 @@ elseif(NOT WIN32) # TODO(RSDK-10366): Currently, rust_utils is not published for
283289 if (NOT lvru_status_code EQUAL 0)
284290 message (FATAL_ERROR "No local viam_rust_utils found and failed to download: ${lvru_status_string} " )
285291 endif ()
286-
292+ else ()
293+ message (WARNING "Currently running on Windows with no rust-utils file. Module code should work as expected, but client code may fail unexpectedly." )
287294endif ()
288295
289- # TODO(RSDK-10366): Currently, rust_utils is not published for windows, so don't even declare the library
290- if (NOT WIN32 )
291- add_library (viam_rust_utils SHARED IMPORTED )
292-
296+ if (NOT WIN32 OR ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "AMD64" )
297+ add_library (viam_rust_utils STATIC IMPORTED )
293298 target_link_directories (viam_rust_utils
294299 INTERFACE
295300 "$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR} >"
296301 "$<INSTALL_INTERFACE:${CMAKE_INSTALL_LIBDIR} >"
297302 )
298-
299303 set_property (TARGET viam_rust_utils PROPERTY IMPORTED_LOCATION ${viam_rust_utils_file} )
300304
301305 install (
302- IMPORTED_RUNTIME_ARTIFACTS viam_rust_utils
303- LIBRARY COMPONENT viam-cpp-sdk_runtime
306+ FILES ${viam_rust_utils_file} DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT viam-cpp-sdk_runtime
304307 )
305308endif ()
306309
0 commit comments