File tree Expand file tree Collapse file tree 3 files changed +20
-8
lines changed Expand file tree Collapse file tree 3 files changed +20
-8
lines changed Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff 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." )
294294endif ()
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+
296308if (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
313325endif ()
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
Original file line number Diff line number Diff 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" ]
You can’t perform that action at this time.
0 commit comments