Skip to content

Commit a24ba82

Browse files
authored
Merge branch 'main' into fix/conan
2 parents 1e855c0 + fcfa076 commit a24ba82

File tree

18 files changed

+4768
-1929
lines changed

18 files changed

+4768
-1929
lines changed

CMakeLists.txt

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
# constrained by the version of CMake available on target systems.
3535
cmake_minimum_required(VERSION 3.25 FATAL_ERROR)
3636

37-
set(CMAKE_PROJECT_VERSION 0.6.0)
37+
set(CMAKE_PROJECT_VERSION 0.7.0)
3838

3939
# Identify the project.
4040
project(viam-cpp-sdk
@@ -173,6 +173,10 @@ if (NOT CMAKE_CXX_STANDARD)
173173
set(CMAKE_CXX_STANDARD 14)
174174
endif()
175175
set(CMAKE_CXX_STANDARD_REQUIRED True)
176+
if(MSVC)
177+
# https://discourse.cmake.org/t/set-cmake-cxx-standard-should-set-zc-cplusplus-for-msvc/1876
178+
string(APPEND CMAKE_CXX_FLAGS " /Zc:__cplusplus")
179+
endif()
176180
set(CMAKE_CXX_EXTENSIONS OFF)
177181

178182

@@ -255,7 +259,7 @@ if (viam_rust_utils_files)
255259
${viam_rust_utils_file}
256260
ONLY_IF_DIFFERENT
257261
)
258-
else()
262+
elseif(NOT WIN32) # TODO(RSDK-10366): Currently, rust_utils is not published for windows, so don't even try downloading
259263
set(lvru_system_name ${CMAKE_SYSTEM_NAME})
260264
if (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
261265
set(lvru_system_name "macosx")
@@ -275,21 +279,23 @@ else()
275279

276280
endif()
277281

278-
add_library(viam_rust_utils SHARED IMPORTED)
282+
# TODO(RSDK-10366): Currently, rust_utils is not published for windows, so don't even declare the library
283+
if (NOT WIN32)
284+
add_library(viam_rust_utils SHARED IMPORTED)
279285

280-
target_link_directories(viam_rust_utils
281-
INTERFACE
286+
target_link_directories(viam_rust_utils
287+
INTERFACE
282288
"$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>"
283289
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_LIBDIR}>"
284-
)
285-
286-
set_property(TARGET viam_rust_utils PROPERTY IMPORTED_LOCATION ${viam_rust_utils_file})
290+
)
287291

288-
install(
289-
IMPORTED_RUNTIME_ARTIFACTS viam_rust_utils
290-
LIBRARY COMPONENT viam-cpp-sdk_runtime
291-
)
292+
set_property(TARGET viam_rust_utils PROPERTY IMPORTED_LOCATION ${viam_rust_utils_file})
292293

294+
install(
295+
IMPORTED_RUNTIME_ARTIFACTS viam_rust_utils
296+
LIBRARY COMPONENT viam-cpp-sdk_runtime
297+
)
298+
endif()
293299

294300
# Install the license file
295301
install(FILES

conanfile.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,11 @@ def package(self):
8282
CMake(self).install()
8383

8484
def package_info(self):
85-
self.cpp_info.components["viam_rust_utils"].libs = ["viam_rust_utils"]
85+
86+
# TODO(RSDK-10366): Currently, rust_utils is not published for windows
87+
# and the C++ SDK just doesn't include it as a dependency on that platform
88+
if not self.settings.os == "Windows":
89+
self.cpp_info.components["viam_rust_utils"].libs = ["viam_rust_utils"]
8690

8791
self.cpp_info.components["viamsdk"].libs = ["viamsdk"]
8892

@@ -103,10 +107,16 @@ def package_info(self):
103107
else:
104108
lib_folder = os.path.join(self.package_folder, "lib")
105109
lib_fullpath = os.path.join(lib_folder, "libviamapi.a")
110+
if self.settings.os == "Windows":
111+
lib_fullpath = os.path.join(lib_folder, "viamapi.lib")
112+
106113
if is_apple_os(self):
107114
whole_archive = f"-Wl,-force_load,{lib_fullpath}"
115+
elif self.settings.os == "Windows":
116+
whole_archive = f"/WHOLEARCHIVE:{lib_fullpath}"
108117
else:
109118
whole_archive = f"-Wl,--push-state,--whole-archive,{lib_fullpath},--pop-state"
119+
110120
self.cpp_info.components["viamapi"].exelinkflags.append(whole_archive)
111121
self.cpp_info.components["viamapi"].sharedlinkflags.append(whole_archive)
112122

@@ -118,7 +128,13 @@ def package_info(self):
118128
"xtensor::xtensor",
119129

120130
"viamapi",
121-
"viam_rust_utils"
122131
])
123132

133+
# TODO(RSDK-10366): Currently, rust_utils is not published for windows
134+
# and the C++ SDK just doesn't include it as a dependency on that platform
135+
if self.settings.os != "Windows":
136+
self.cpp_info.components["viamsdk"].requires.extend([
137+
"viam_rust_utils"
138+
])
139+
124140
self.cpp_info.components["viamsdk"].frameworks = ["Security"]

src/viam/api/api_proto_tag.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v0.1.417
1+
v0.1.424

src/viam/api/app/v1/app.grpc.pb.cc

Lines changed: 151 additions & 57 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/viam/api/app/v1/app.grpc.pb.h

Lines changed: 723 additions & 294 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/viam/api/app/v1/app.pb.cc

Lines changed: 2055 additions & 983 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)