From 1c9261d707f317e75061e2cb97bfdf0427501bbd Mon Sep 17 00:00:00 2001 From: abe-winter Date: Wed, 13 Sep 2023 12:58:41 -0400 Subject: [PATCH] RSDK-4760 consume .a from rust-utils (#146) --- .github/workflows/linter.yml | 1 + CMakeLists.txt | 8 ++++---- src/viam/examples/modules/simple/main.cpp | 1 + src/viam/sdk/CMakeLists.txt | 5 +++++ 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 9ade0ea02..94d27816b 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -26,5 +26,6 @@ jobs: if [ -n "$GEN_DIFF" ]; then echo 'linting resulted in changes not in git' 1>&2 git status + git diff exit 1 fi diff --git a/CMakeLists.txt b/CMakeLists.txt index 329706b84..ddec2e96b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -224,10 +224,10 @@ find_package(Threads REQUIRED) # # TODO: When this is removed, also remove the # `target_link_directories` call down in src/CMakeLists.txt, as it -# will no longer be neede. -set(viam_rust_utils_file ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_SHARED_LIBRARY_PREFIX}viam_rust_utils${CMAKE_SHARED_LIBRARY_SUFFIX}) +# will no longer be needed. +set(viam_rust_utils_file ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_SHARED_LIBRARY_PREFIX}viam_rust_utils${CMAKE_STATIC_LIBRARY_SUFFIX}) -file(GLOB viam_rust_utils_files ${PROJECT_SOURCE_DIR}/${CMAKE_SHARED_LIBRARY_PREFIX}viam_rust_utils*${CMAKE_SHARED_LIBRARY_SUFFIX}) +file(GLOB viam_rust_utils_files ${PROJECT_SOURCE_DIR}/${CMAKE_SHARED_LIBRARY_PREFIX}viam_rust_utils*${CMAKE_STATIC_LIBRARY_SUFFIX}) if (viam_rust_utils_files) list(LENGTH viam_rust_utils_files num_viam_rust_utils_files) @@ -246,7 +246,7 @@ else() endif() file( DOWNLOAD - https://github.com/viamrobotics/rust-utils/releases/latest/download/${CMAKE_SHARED_LIBRARY_PREFIX}viam_rust_utils-${lvru_system_name}_${CMAKE_SYSTEM_PROCESSOR}${CMAKE_SHARED_LIBRARY_SUFFIX} + 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} ${viam_rust_utils_file} STATUS lvru_status ) diff --git a/src/viam/examples/modules/simple/main.cpp b/src/viam/examples/modules/simple/main.cpp index 5a5343e9a..b0a7757cc 100644 --- a/src/viam/examples/modules/simple/main.cpp +++ b/src/viam/examples/modules/simple/main.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #include #include diff --git a/src/viam/sdk/CMakeLists.txt b/src/viam/sdk/CMakeLists.txt index 98db10d08..8da617bba 100644 --- a/src/viam/sdk/CMakeLists.txt +++ b/src/viam/sdk/CMakeLists.txt @@ -202,6 +202,11 @@ target_link_libraries(viamsdk ) +if (APPLE) + target_link_libraries(viamsdk PUBLIC "-framework Security") +endif() + + install( TARGETS viamsdk EXPORT viamsdk