Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Nanopb] 0.4.7 #28982

Merged
merged 10 commits into from
Jan 18, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions ports/nanopb/fix-cmakelist-and-pb-header.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8d241c5..4a3d31e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -14,11 +14,6 @@ option(nanopb_BUILD_RUNTIME "Build the headers and libraries needed at runtime"
option(nanopb_BUILD_GENERATOR "Build the protoc plugin for code generation" ON)
option(nanopb_MSVC_STATIC_RUNTIME "Link static runtime libraries" ON)

-find_program(nanopb_PROTOC_PATH protoc HINTS generator-bin generator)
-if(NOT EXISTS ${nanopb_PROTOC_PATH})
- message(FATAL_ERROR "protoc compiler not found")
-endif()
-
if(NOT DEFINED CMAKE_DEBUG_POSTFIX)
set(CMAKE_DEBUG_POSTFIX "d")
endif()
@@ -39,7 +34,6 @@ if(NOT DEFINED CMAKE_INSTALL_CMAKEDIR)
set(CMAKE_INSTALL_CMAKEDIR "${CMAKE_INSTALL_LIBDIR}/cmake/nanopb")
endif()

-find_package(Python REQUIRED COMPONENTS Interpreter)
execute_process(
COMMAND ${Python_EXECUTABLE} -c
"import os.path, sys, sysconfig; print(os.path.relpath(sysconfig.get_path('purelib'), start=sys.prefix))"
@@ -49,7 +43,9 @@ execute_process(

if(nanopb_BUILD_GENERATOR)
set(generator_protos nanopb)
-
+ if(NOT DEFINED nanopb_PROTOC_PATH)
+ message(FATAL_ERROR "nanopb_PROTOC_PATH not defined")
+ endif()
foreach(generator_proto IN LISTS generator_protos)
string(REGEX REPLACE "([^;]+)" "${PROJECT_SOURCE_DIR}/generator/proto/\\1.proto" generator_proto_file "${generator_proto}")
string(REGEX REPLACE "([^;]+)" "\\1_pb2.py" generator_proto_py_file "${generator_proto}")
diff --git a/pb.h b/pb.h
index 5b3e1ef..693262b 100644
--- a/pb.h
+++ b/pb.h
@@ -170,6 +170,9 @@ extern "C" {
# if defined(__ICCARM__)
/* IAR has static_assert keyword but no _Static_assert */
# define PB_STATIC_ASSERT(COND,MSG) static_assert(COND,#MSG);
+# elif defined(_MSC_VER)
+ /* MSVC has static_assert keyword but no _Static_assert */
+# define PB_STATIC_ASSERT(COND,MSG) static_assert(COND,#MSG);
# elif defined(PB_C99_STATIC_ASSERT)
/* Classic negative-size-array static assert mechanism */
# define PB_STATIC_ASSERT(COND,MSG) typedef char PB_STATIC_ASSERT_MSG(MSG, __LINE__, __COUNTER__)[(COND)?1:-1];
25 changes: 0 additions & 25 deletions ports/nanopb/fix-python.patch

This file was deleted.

6 changes: 3 additions & 3 deletions ports/nanopb/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO nanopb/nanopb
REF 0.4.5
SHA512 2f24308440bd961a94449e253627fbe38f6c5217cd70c57e9b3ab702da3c2df03b087ccdd62518940acf6b480a1dbb440ca5681f1766a17b199010d3df7b17a1
REF 0.4.7
SHA512 7fb46dad8a432898c8f9e7faa90a55276670dea3b13f15b68010fe126d7f6251ef5715d0dfe5bce66582e80cfdc5d4b1e7f5947e96a058fa7181f0a45da20860
HEAD_REF master
PATCHES
fix-python.patch
fix-cmakelist-and-pb-header.patch
)

string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" nanopb_BUILD_STATIC_LIBS)
Expand Down
2 changes: 1 addition & 1 deletion ports/nanopb/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nanopb",
"version-semver": "0.4.5",
"version-semver": "0.4.7",
"description": "A small code-size Protocol Buffers implementation in ANSI C.",
"homepage": "https://jpa.kapsi.fi/nanopb/",
"features": {
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -5209,7 +5209,7 @@
"port-version": 4
},
"nanopb": {
"baseline": "0.4.5",
"baseline": "0.4.7",
"port-version": 0
},
"nanoprintf": {
Expand Down
5 changes: 5 additions & 0 deletions versions/n-/nanopb.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "5f79ac97624f5cbf39d444647a6fc473bf0a76ef",
"version-semver": "0.4.7",
"port-version": 0
},
{
"git-tree": "855b599338a79c3a7d61c1171110e4dd49c3f164",
"version-semver": "0.4.5",
Expand Down