Skip to content

Commit 1bd47b2

Browse files
committed
test from convo with drew
1 parent 7afa451 commit 1bd47b2

File tree

3 files changed

+20
-8
lines changed

3 files changed

+20
-8
lines changed

.github/workflows/conan.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,7 @@ jobs:
8686
conan profile detect
8787
conan create . `
8888
--build=missing `
89-
-o "&:shared=False" `
90-
-s:h compiler.cppstd=17 `
91-
-s:h compiler.runtime=static
89+
-o "&:shared=False"
9290
env:
9391
CONAN_USER_HOME: c:/cache
9492
CONAN_USER_HOME_SHORT: c:/cache/conan_shortpaths

CMakeLists.txt

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,18 @@ else()
293293
message(WARNING "Currently running on Windows with no rust-utils file. Module code should work as expected, but client code may fail unexpectedly.")
294294
endif()
295295

296+
if (APPLE)
297+
target_link_libraries(viam_rust_utils PUBLIC "-framework Security")
298+
elseif (NOT WIN32)
299+
target_link_libraries(viam_rust_utils PRIVATE dl)
300+
target_link_libraries(viam_rust_utils PRIVATE rt)
301+
else()
302+
target_link_libraries(viam_rust_utils PRIVATE ncrypt)
303+
target_link_libraries(viam_rust_utils PRIVATE secur32)
304+
target_link_libraries(viam_rust_utils PRIVATE ntdll)
305+
target_link_libraries(viam_rust_utils PRIVATE userenv)
306+
endif()
307+
296308
if (NOT WIN32) # build `SHARED` on unix-based systems
297309
add_library(viam_rust_utils SHARED IMPORTED)
298310
target_link_directories(viam_rust_utils
@@ -313,7 +325,7 @@ elseif (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "AMD64") # build `STATIC` for windows
313325
endif()
314326

315327

316-
if (NOT WIN32) # installing seems to be necessary for tests to pass in CI
328+
if (BUILD_SHARED_LIBS) # installing seems to be necessary for tests to pass in CI
317329
install(
318330
IMPORTED_RUNTIME_ARTIFACTS viam_rust_utils
319331
LIBRARY COMPONENT viam-cpp-sdk_runtime

conanfile.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@ def package(self):
9191

9292
def package_info(self):
9393

94-
self.cpp_info.components["viam_rust_utils"].libs = ["viam_rust_utils"]
94+
if self.options.shared:
95+
self.cpp_info.components["viam_rust_utils"].libs = ["viam_rust_utils"]
9596

9697
self.cpp_info.components["viamsdk"].libs = ["viamsdk"]
9798

@@ -134,8 +135,9 @@ def package_info(self):
134135
"viamapi",
135136
])
136137

137-
self.cpp_info.components["viamsdk"].requires.extend([
138-
"viam_rust_utils"
139-
])
138+
if self.options.shared:
139+
self.cpp_info.components["viamsdk"].requires.extend([
140+
"viam_rust_utils"
141+
])
140142

141143
self.cpp_info.components["viamsdk"].frameworks = ["Security"]

0 commit comments

Comments
 (0)