Skip to content

Commit 7e69031

Browse files
committed
Merge branch 'main' of github.com:viamrobotics/viam-cpp-sdk into fix/conan
2 parents 603c148 + 9c65e45 commit 7e69031

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+4427
-820
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ jobs:
144144
sudo echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ jammy main' | sudo tee /etc/apt/sources.list.d/kitware.list >/dev/null
145145
146146
apt-get update
147-
apt-get -y install cmake
147+
apt-get -y install cmake=3.25.2-0kitware1ubuntu22.04.1 cmake-data=3.25.2-0kitware1ubuntu22.04.1
148148
149149
- name: Setup build directory
150150
run: mkdir builds

CMakeLists.txt

Lines changed: 5 additions & 1 deletion
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.4.0)
37+
set(CMAKE_PROJECT_VERSION 0.6.0)
3838

3939
# Identify the project.
4040
project(viam-cpp-sdk
@@ -150,6 +150,10 @@ if (VIAMCPPSDK_ENFORCE_COMPILER_MINIMA)
150150
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 10.0)
151151
message(FATAL_ERROR "Insufficient Apple clang version: XCode 10.0+ required")
152152
endif()
153+
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
154+
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.34)
155+
message(FATAL_ERROR "Insufficient MSVC version: Visual Studio 2022 17.4 (MSVC 19.34) or later is required")
156+
endif()
153157
else()
154158
message(FATAL_ERROR "Unknown / untested compiler ${CMAKE_CXX_COMPILER_ID}")
155159
endif()

src/viam/api/CMakeLists.txt

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,16 @@ if (VIAMCPPSDK_USE_DYNAMIC_PROTOS)
113113
)
114114
endif()
115115

116+
# List of names of non-compilable generated code
117+
# The Switch component generates protobuf which uses `switch` as a namespace.
118+
# This needs to be processed below.
119+
set(VIAMCPPSDK_SWITCH_REPLACE_PATHS
120+
${PROTO_GEN_DIR}/component/switch/v1/switch.grpc.pb.cc
121+
${PROTO_GEN_DIR}/component/switch/v1/switch.grpc.pb.h
122+
${PROTO_GEN_DIR}/component/switch/v1/switch.pb.cc
123+
${PROTO_GEN_DIR}/component/switch/v1/switch.pb.h
124+
)
125+
116126
add_custom_command(
117127
OUTPUT
118128
# Unfortunately, there isn't a good way to know in advance what
@@ -153,6 +163,10 @@ if (VIAMCPPSDK_USE_DYNAMIC_PROTOS)
153163
${PROTO_GEN_DIR}/component/board/v1/board.grpc.pb.h
154164
${PROTO_GEN_DIR}/component/board/v1/board.pb.cc
155165
${PROTO_GEN_DIR}/component/board/v1/board.pb.h
166+
${PROTO_GEN_DIR}/component/button/v1/button.grpc.pb.cc
167+
${PROTO_GEN_DIR}/component/button/v1/button.grpc.pb.h
168+
${PROTO_GEN_DIR}/component/button/v1/button.pb.cc
169+
${PROTO_GEN_DIR}/component/button/v1/button.pb.h
156170
${PROTO_GEN_DIR}/component/camera/v1/camera.grpc.pb.cc
157171
${PROTO_GEN_DIR}/component/camera/v1/camera.grpc.pb.h
158172
${PROTO_GEN_DIR}/component/camera/v1/camera.pb.cc
@@ -197,6 +211,10 @@ if (VIAMCPPSDK_USE_DYNAMIC_PROTOS)
197211
${PROTO_GEN_DIR}/component/servo/v1/servo.grpc.pb.h
198212
${PROTO_GEN_DIR}/component/servo/v1/servo.pb.cc
199213
${PROTO_GEN_DIR}/component/servo/v1/servo.pb.h
214+
${PROTO_GEN_DIR}/component/switch/v1/switch.grpc.pb.cc
215+
${PROTO_GEN_DIR}/component/switch/v1/switch.grpc.pb.h
216+
${PROTO_GEN_DIR}/component/switch/v1/switch.pb.cc
217+
${PROTO_GEN_DIR}/component/switch/v1/switch.pb.h
200218
${PROTO_GEN_DIR}/google/api/annotations.pb.cc
201219
${PROTO_GEN_DIR}/google/api/annotations.pb.h
202220
${PROTO_GEN_DIR}/google/api/httpbody.pb.cc
@@ -241,6 +259,9 @@ if (VIAMCPPSDK_USE_DYNAMIC_PROTOS)
241259
COMMAND ${BUF_COMMAND} generate ${BUF_GOOGLE_API_SOURCE} --template buf.gen.yaml --path google/rpc --path google/api
242260
COMMAND ${BUF_COMMAND} generate ${BUF_VIAM_GOUTILS_SOURCE} --template buf.gen.yaml
243261
COMMAND ${BUF_COMMAND} generate ${BUF_VIAM_API_SOURCE} --template buf.gen.yaml --path ${BUF_PROTO_COMPONENTS_JOINED}
262+
263+
# After generating the protos, include a step to invoke a search-and-replace for switch -> switch_ in the Switch component files
264+
COMMAND ${CMAKE_COMMAND} "-DSWITCH_REPLACE_PATHS=\"${VIAMCPPSDK_SWITCH_REPLACE_PATHS}\"" -P ${CMAKE_CURRENT_SOURCE_DIR}/viamcppsdk_replace_switch.cmake
244265
MAIN_DEPENDENCY buf.gen.yaml
245266
)
246267

@@ -300,6 +321,8 @@ target_sources(viamapi
300321
${PROTO_GEN_DIR}/component/base/v1/base.pb.cc
301322
${PROTO_GEN_DIR}/component/board/v1/board.grpc.pb.cc
302323
${PROTO_GEN_DIR}/component/board/v1/board.pb.cc
324+
${PROTO_GEN_DIR}/component/button/v1/button.grpc.pb.cc
325+
${PROTO_GEN_DIR}/component/button/v1/button.pb.cc
303326
${PROTO_GEN_DIR}/component/camera/v1/camera.grpc.pb.cc
304327
${PROTO_GEN_DIR}/component/camera/v1/camera.pb.cc
305328
${PROTO_GEN_DIR}/component/encoder/v1/encoder.grpc.pb.cc
@@ -322,6 +345,8 @@ target_sources(viamapi
322345
${PROTO_GEN_DIR}/component/sensor/v1/sensor.pb.cc
323346
${PROTO_GEN_DIR}/component/servo/v1/servo.grpc.pb.cc
324347
${PROTO_GEN_DIR}/component/servo/v1/servo.pb.cc
348+
${PROTO_GEN_DIR}/component/switch/v1/switch.grpc.pb.cc
349+
${PROTO_GEN_DIR}/component/switch/v1/switch.pb.cc
325350
${PROTO_GEN_DIR}/google/api/annotations.pb.cc
326351
${PROTO_GEN_DIR}/google/api/http.pb.cc
327352
${PROTO_GEN_DIR}/google/api/httpbody.pb.cc
@@ -360,6 +385,8 @@ target_sources(viamapi
360385
${PROTO_GEN_DIR}/../../viam/api/component/base/v1/base.pb.h
361386
${PROTO_GEN_DIR}/../../viam/api/component/board/v1/board.grpc.pb.h
362387
${PROTO_GEN_DIR}/../../viam/api/component/board/v1/board.pb.h
388+
${PROTO_GEN_DIR}/../../viam/api/component/button/v1/button.grpc.pb.h
389+
${PROTO_GEN_DIR}/../../viam/api/component/button/v1/button.pb.h
363390
${PROTO_GEN_DIR}/../../viam/api/component/camera/v1/camera.grpc.pb.h
364391
${PROTO_GEN_DIR}/../../viam/api/component/camera/v1/camera.pb.h
365392
${PROTO_GEN_DIR}/../../viam/api/component/encoder/v1/encoder.grpc.pb.h
@@ -382,6 +409,8 @@ target_sources(viamapi
382409
${PROTO_GEN_DIR}/../../viam/api/component/sensor/v1/sensor.pb.h
383410
${PROTO_GEN_DIR}/../../viam/api/component/servo/v1/servo.grpc.pb.h
384411
${PROTO_GEN_DIR}/../../viam/api/component/servo/v1/servo.pb.h
412+
${PROTO_GEN_DIR}/../../viam/api/component/switch/v1/switch.grpc.pb.h
413+
${PROTO_GEN_DIR}/../../viam/api/component/switch/v1/switch.pb.h
385414
${PROTO_GEN_DIR}/../../viam/api/google/api/annotations.pb.h
386415
${PROTO_GEN_DIR}/../../viam/api/google/api/http.pb.h
387416
${PROTO_GEN_DIR}/../../viam/api/google/api/httpbody.pb.h

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.413
1+
v0.1.417

0 commit comments

Comments
 (0)