Skip to content

Commit 07470b2

Browse files
committed
try keeping shared for unix pt2
1 parent f1ba0d3 commit 07470b2

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

CMakeLists.txt

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -289,24 +289,31 @@ else()
289289
endif()
290290

291291
# TODO(RSDK-10637): Currently, rust_utils doesn't build correctly for windows in CI, so don't declare the library unless a user has provided their own build
292-
if (NOT WIN32 OR num_viam_rust_utils_files GREATER 0)
293-
if (WIN32)
294-
add_library(viam_rust_utils STATIC IMPORTED)
292+
if (NOT WIN32)
293+
add_library(viam_rust_utils SHARED IMPORTED)
295294
target_link_directories(viam_rust_utils
296295
INTERFACE
297296
"$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>"
297+
"$<INSTALL_INTERFACE<:${CMAKE_INSTALL_LIBDIR}>"
298298
)
299-
else()
300-
add_library(viam_rust_utils SHARED IMPORTED)
299+
set_property(TARGET viam_rust_utils PROPERTY IMPORTED_LOCATION ${viam_rust_utils_file})
300+
elseif (num_viam_rust_utils_files GREATER 0)
301+
add_library(viam_rust_utils STATIC IMPORTED)
301302
target_link_directories(viam_rust_utils
302303
INTERFACE
303304
"$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>"
304305
)
305-
endif()
306-
307306
set_property(TARGET viam_rust_utils PROPERTY IMPORTED_LOCATION ${viam_rust_utils_file})
308307
endif()
309308

309+
310+
if (NOT WIN32)
311+
install(
312+
IMPORTED_RUNTIME_ARTIFACTS viam_rust_utils
313+
LIBRARY COMPONENT viam-cpp-sdk_runtime
314+
)
315+
endif()
316+
310317
# Install the license file
311318
install(FILES
312319
LICENSE

0 commit comments

Comments
 (0)