Skip to content

Commit 24b452c

Browse files
committed
upgrade protobuf
1 parent daf383b commit 24b452c

File tree

18 files changed

+127
-94
lines changed

18 files changed

+127
-94
lines changed

external/protobuf/CMakeLists.txt

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ if (EMIL_HOST_BUILD)
22
FetchContent_Declare(
33
protobuf
44
GIT_REPOSITORY https://github.com/protocolbuffers/protobuf
5-
GIT_TAG f0dc78d7e6e331b8c6bb2d5283e06aa26883ca7c # v21.12
5+
GIT_TAG b407e8416e3893036aee5af9a12bd9b6a0e2b2e6 # v29.3
66
)
77

88
set_directory_properties(PROPERTIES EXCLUDE_FROM_ALL On)
@@ -13,13 +13,23 @@ if (EMIL_HOST_BUILD)
1313
$<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>:-Wno-deprecated-declarations$<SEMICOLON>-Wno-invalid-noreturn>
1414
# Disable string overflow warning
1515
$<$<CXX_COMPILER_ID:GNU>:-Wno-stringop-overflow>
16+
$<$<CXX_COMPILER_ID:Clang>:-fclang-abi-compat=17>
1617
)
1718

18-
set(protobuf_BUILD_TESTS Off CACHE INTERNAL "")
19-
set(protobuf_BUILD_PROTOBUF_BINARIES Off CACHE INTERNAL "")
19+
set(protobuf_VERBOSE On CACHE INTERNAL "")
2020
set(protobuf_BUILD_LIBPROTOC On CACHE INTERNAL "")
21+
set(protobuf_BUILD_PROTOC_BINARIES On CACHE INTERNAL "")
2122
set(protobuf_MSVC_STATIC_RUNTIME Off CACHE INTERNAL "")
2223
set(protobuf_WITH_ZLIB Off CACHE INTERNAL "")
24+
set(protobuf_BUILD_TESTS Off CACHE INTERNAL "")
25+
set(protobuf_INSTALL Off CACHE INTERNAL "")
26+
27+
set(ABSL_PROPAGATE_CXX_STD On CACHE INTERNAL "")
28+
set(ABSL_FIND_GOOGLETEST On CACHE INTERNAL "")
29+
set(ABSL_USE_EXTERNAL_GOOGLETEST Off CACHE INTERNAL "")
30+
set(ABSL_BUILD_TESTING Off CACHE INTERNAL "")
31+
set(ABSL_BUILD_TEST_HELPERS Off CACHE INTERNAL "")
32+
set(ABSL_ENABLE_INSTALL Off CACHE INTERNAL "")
2333

2434
FetchContent_MakeAvailable(protobuf)
2535

external/protoc/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
function(emil_fetch_protocol_buffer_compiler)
2-
set(protobuf_version "21.12")
2+
set(protobuf_version "29.3")
33

44
if (CMAKE_HOST_WIN32)
55
set(os_postfix "win32")

hal/interfaces/test_doubles/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
add_library(hal.interfaces_test_doubles STATIC)
2-
emil_build_for(hal.interfaces_test_doubles BOOL BUILD_TESTING)
1+
add_library(hal.interfaces_test_doubles STATIC EXCLUDE_FROM_ALL)
2+
# emil_build_for(hal.interfaces_test_doubles BOOL BUILD_TESTING)
33

44
target_link_libraries(hal.interfaces_test_doubles PRIVATE
55
hal.interfaces

hal/synchronous_interfaces/test_doubles/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
add_library(hal.synchronous_interfaces_test_doubles STATIC)
2-
emil_build_for(hal.synchronous_interfaces_test_doubles BOOL BUILD_TESTING)
1+
add_library(hal.synchronous_interfaces_test_doubles STATIC EXCLUDE_FROM_ALL)
2+
# emil_build_for(hal.synchronous_interfaces_test_doubles BOOL BUILD_TESTING)
33

44
target_link_libraries(hal.synchronous_interfaces_test_doubles PUBLIC
55
hal.synchronous_interfaces

infra/syntax/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,9 @@ if (EMIL_HOST_BUILD)
5050
)
5151

5252
target_link_libraries(infra.syntax PUBLIC
53-
protobuf::libprotoc
53+
libprotoc
5454
pugixml
55+
libprotobuf
5556
)
5657
endif()
5758

infra/timer/test_helper/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
add_library(infra.timer_test_helper STATIC)
2-
emil_build_for(infra.timer_test_helper BOOL BUILD_TESTING)
1+
add_library(infra.timer_test_helper STATIC EXCLUDE_FROM_ALL)
2+
# emil_build_for(infra.timer_test_helper BOOL BUILD_TESTING)
33

44
target_link_libraries(infra.timer_test_helper PRIVATE
55
infra.timer

infra/util/test_helper/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
add_library(infra.util_test_helper INTERFACE)
2-
emil_build_for(infra.util_test_helper BOOL BUILD_TESTING)
1+
add_library(infra.util_test_helper INTERFACE EXCLUDE_FROM_ALL)
2+
# emil_build_for(infra.util_test_helper BOOL BUILD_TESTING)
33

44
target_link_libraries(infra.util_test_helper INTERFACE
55
gmock

protobuf/echo/test/TestMessages.proto

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,8 @@ message TestOptionalEverything {
132132
optional bool v9 = 10;
133133
optional string v10 = 11 [(string_size) = 20];
134134
optional string v11 = 12;
135-
optional TestUInt32 v12 = 13;
136-
optional bytes v13 = 14 [(bytes_size) = 10];
137-
optional bytes v14 = 15;
135+
optional bytes v12 = 13 [(bytes_size) = 10];
136+
optional bytes v13 = 14;
138137
}
139138

140139
message TestNestedMessage

protobuf/echo/test/TestProtoMessageReceiver.cpp

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -252,24 +252,28 @@ TEST(ProtoMessageReceiverTest, parse_optionals_all_none)
252252
EXPECT_EQ(infra::none, receiver.message.v9);
253253
EXPECT_EQ(infra::none, receiver.message.v10);
254254
EXPECT_EQ(infra::none, receiver.message.v11);
255-
EXPECT_EQ(infra::none, receiver.message.v12);
256255
EXPECT_EQ(infra::none, receiver.message.v13);
257-
EXPECT_EQ(infra::none, receiver.message.v14);
258256
}
259257

260258
TEST(ProtoMessageReceiverTest, parse_optionals_all_filled)
261259
{
262260
services::ProtoMessageReceiver<test_messages::TestOptionalEverything> receiver;
263261

264262
infra::StdVectorInputStreamReader::WithStorage data(infra::inPlace, std::initializer_list<uint8_t>{
265-
0x08, 0x01, 0x10, 0x02, 0x18, 0x03, 0x20, 0x04,
266-
0x28, 0x05, 0x35, 0x06, 0x00, 0x00, 0x00, 0x39,
267-
0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
268-
0x41, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
269-
0x00, 0x4d, 0x09, 0x00, 0x00, 0x00, 0x50, 0x01,
270-
0x5a, 0x01, 0x61, 0x62, 0x01, 0x62, 0x6a, 0x02,
271-
0x08, 0x0a, 0x72, 0x02, 0x0b, 0x0b, 0x7a, 0x02,
272-
0x0c, 0x0c });
263+
0x08, 0x01,
264+
0x10, 0x02,
265+
0x18, 0x03,
266+
0x20, 0x04,
267+
0x28, 0x05,
268+
0x35, 0x06, 0x00, 0x00, 0x00,
269+
0x39, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
270+
0x41, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
271+
0x4d, 0x09, 0x00, 0x00, 0x00,
272+
0x50, 0x01,
273+
0x5a, 0x01, 0x61,
274+
0x62, 0x01, 0x62,
275+
0x6a, 0x02, 0x0b, 0x0b,
276+
0x72, 0x02, 0x0c, 0x0c });
273277
receiver.Feed(data);
274278

275279
EXPECT_EQ(test_messages::Enumeration::val1, *receiver.message.v0);
@@ -284,7 +288,6 @@ TEST(ProtoMessageReceiverTest, parse_optionals_all_filled)
284288
EXPECT_EQ(true, *receiver.message.v9);
285289
EXPECT_EQ("a", *receiver.message.v10);
286290
EXPECT_EQ("b", *receiver.message.v11);
287-
EXPECT_EQ(test_messages::TestUInt32(10), *receiver.message.v12);
288-
EXPECT_EQ((infra::BoundedVector<uint8_t>::WithMaxSize<2>(static_cast<std::size_t>(2), 11)), *receiver.message.v13);
289-
EXPECT_EQ((std::vector<uint8_t>(2, 12)), *receiver.message.v14);
291+
EXPECT_EQ((infra::BoundedVector<uint8_t>::WithMaxSize<2>(static_cast<std::size_t>(2), 11)), *receiver.message.v12);
292+
EXPECT_EQ((std::vector<uint8_t>(2, 12)), *receiver.message.v13);
290293
}

protobuf/echo/test/TestProtoMessageSender.cpp

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -254,21 +254,27 @@ TEST_F(ProtoMessageSenderTest, format_optionals_all_filled)
254254
message.v9 = true;
255255
message.v10 = "a";
256256
message.v11 = "b";
257-
message.v12 = test_messages::TestUInt32(10);
258-
message.v13.Emplace(static_cast<std::size_t>(2), 11);
259-
message.v14.Emplace(2, 12);
257+
message.v12.Emplace(static_cast<std::size_t>(2), 11);
258+
message.v13.Emplace(2, 12);
260259
services::ProtoMessageSender sender{ message };
261260

262261
infra::StdVectorOutputStream::WithStorage stream;
263262
sender.Fill(stream);
264263
EXPECT_EQ((std::vector<uint8_t>{
265-
0x08, 0x01, 0x10, 0x02, 0x18, 0x03, 0x20, 0x04,
266-
0x28, 0x05, 0x35, 0x06, 0x00, 0x00, 0x00, 0x39,
267-
0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
264+
0x08, 0x01,
265+
0x10, 0x02,
266+
0x18, 0x03,
267+
0x20, 0x04,
268+
0x28, 0x05,
269+
0x35, 0x06, 0x00, 0x00, 0x00,
270+
0x39, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
268271
0x41, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
269-
0x00, 0x4d, 0x09, 0x00, 0x00, 0x00, 0x50, 0x01,
270-
0x5a, 0x01, 0x61, 0x62, 0x01, 0x62, 0x6a, 0x02,
271-
0x08, 0x0a, 0x72, 0x02, 0x0b, 0x0b, 0x7a, 0x02,
272-
0x0c, 0x0c }),
272+
0x00,
273+
0x4d, 0x09, 0x00, 0x00, 0x00,
274+
0x50, 0x01,
275+
0x5a, 0x01, 0x61,
276+
0x62, 0x01, 0x62,
277+
0x6a, 0x02, 0x0b, 0x0b,
278+
0x72, 0x02, 0x0c, 0x0c }),
273279
stream.Storage());
274280
}

0 commit comments

Comments
 (0)