mirror of
https://github.com/microsoft/vcpkg.git
synced 2025-06-07 13:26:32 +08:00
[protobuf-c] Update to 1.4.0 (#21418)
* Update protobuf-c to 1.4.0 * Update CI baseline * Remove entries from CI baseline * Fix CRT linkage * Update CI baseline * Minimize patch * Update CI baseline Co-authored-by: chausner <chausner@users.noreply.github.com>
This commit is contained in:
parent
0e41598b14
commit
c3bab00ceb
12
ports/protobuf-c/fix-crt-linkage.patch
Normal file
12
ports/protobuf-c/fix-crt-linkage.patch
Normal file
@ -0,0 +1,12 @@
|
||||
diff --git a/build-cmake/CMakeLists.txt b/build-cmake/CMakeLists.txt
|
||||
--- a/build-cmake/CMakeLists.txt
|
||||
+++ b/build-cmake/CMakeLists.txt
|
||||
@@ -70,7 +70,7 @@ if (BUILD_PROTO3)
|
||||
endif()
|
||||
ENDIF()
|
||||
|
||||
-if (MSVC AND NOT BUILD_SHARED_LIBS)
|
||||
+if (0)
|
||||
# In case we are building static libraries, link also the runtime library statically
|
||||
# so that MSVCR*.DLL is not required at runtime.
|
||||
# https://msdn.microsoft.com/en-us/library/2kzt1wy3.aspx
|
@ -1,62 +0,0 @@
|
||||
diff --git a/build-cmake/CMakeLists.txt b/build-cmake/CMakeLists.txt
|
||||
index bc1728f..7c6a04d 100644
|
||||
--- a/build-cmake/CMakeLists.txt
|
||||
+++ b/build-cmake/CMakeLists.txt
|
||||
@@ -61,11 +61,15 @@ if (MSVC AND MSVC_STATIC_BUILD)
|
||||
endif(${flag_var} MATCHES "/MD")
|
||||
endforeach(flag_var)
|
||||
endif (MSVC AND MSVC_STATIC_BUILD)
|
||||
+
|
||||
+IF(WITH_TOOLS)
|
||||
FILE(GLOB PROTOC_GEN_C_SRC ${MAIN_DIR}/protoc-c/*.h ${MAIN_DIR}/protoc-c/*.cc )
|
||||
ADD_EXECUTABLE(protoc-gen-c ${PROTOC_GEN_C_SRC})
|
||||
|
||||
TARGET_LINK_LIBRARIES(protoc-gen-c ${PROTOBUF_PROTOC_LIBRARY} ${PROTOBUF_LIBRARY})
|
||||
+ENDIF()
|
||||
|
||||
+IF(WITH_TEST AND WITH_TOOLS)
|
||||
IF(CMAKE_HOST_UNIX)
|
||||
ADD_CUSTOM_COMMAND(TARGET ${PROJECT_NAME} POST_BUILD
|
||||
COMMAND ln -sf protoc-gen-c protoc-c
|
||||
@@ -79,8 +83,6 @@ FUNCTION(GENERATE_TEST_SOURCES PROTO_FILE SRC HDR)
|
||||
DEPENDS protoc-gen-c)
|
||||
ENDFUNCTION()
|
||||
|
||||
-
|
||||
-IF(CMAKE_BUILD_TYPE MATCHES Debug)
|
||||
ENABLE_TESTING()
|
||||
|
||||
GENERATE_TEST_SOURCES(${TEST_DIR}/test.proto t/test.pb-c.c t/test.pb-c.h)
|
||||
@@ -126,17 +128,17 @@ GENERATE_TEST_SOURCES(${TEST_DIR}/test-proto3.proto t/test-proto3.pb-c.c t/test-
|
||||
ADD_EXECUTABLE(test-generated-code3 ${TEST_DIR}/generated-code/test-generated-code.c t/test-proto3.pb-c.c t/test-proto3.pb-c.h)
|
||||
TARGET_COMPILE_DEFINITIONS(test-generated-code3 PUBLIC -DPROTO3)
|
||||
TARGET_LINK_LIBRARIES(test-generated-code3 protobuf-c)
|
||||
-
|
||||
ENDIF()
|
||||
|
||||
-INSTALL(TARGETS protoc-gen-c protobuf-c RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib)
|
||||
-INSTALL(FILES ${MAIN_DIR}/protobuf-c/protobuf-c.h DESTINATION include/protobuf-c)
|
||||
-INSTALL(FILES ${MAIN_DIR}/protobuf-c/protobuf-c.h DESTINATION include)
|
||||
+IF (WITH_TOOLS)
|
||||
+INSTALL(TARGETS protoc-gen-c RUNTIME DESTINATION tools LIBRARY DESTINATION lib ARCHIVE DESTINATION lib)
|
||||
+ENDIF()
|
||||
|
||||
IF(CMAKE_HOST_UNIX)
|
||||
INSTALL(CODE "EXECUTE_PROCESS (COMMAND ln -sf protoc-gen-c protoc-c WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}/bin)")
|
||||
ENDIF()
|
||||
|
||||
+IF (WITH_TEST)
|
||||
INCLUDE(Dart)
|
||||
|
||||
SET(DART_TESTING_TIMEOUT 5)
|
||||
@@ -147,5 +149,10 @@ ADD_TEST(test-issue220 test-issue220)
|
||||
ADD_TEST(test-issue251 test-issue251)
|
||||
ADD_TEST(test-version test-version)
|
||||
|
||||
+ENDIF()
|
||||
+
|
||||
+INSTALL(TARGETS protobuf-c RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib)
|
||||
+INSTALL(FILES ${MAIN_DIR}/protobuf-c/protobuf-c.h DESTINATION include/protobuf-c)
|
||||
+INSTALL(FILES ${MAIN_DIR}/protobuf-c/protobuf-c.h DESTINATION include)
|
||||
|
||||
INCLUDE(CPack)
|
@ -1,36 +0,0 @@
|
||||
diff --git a/build-cmake/CMakeLists.txt b/build-cmake/CMakeLists.txt
|
||||
index 7c6a04d..83534cb 100644
|
||||
--- a/build-cmake/CMakeLists.txt
|
||||
+++ b/build-cmake/CMakeLists.txt
|
||||
@@ -14,6 +14,11 @@ option(BUILD_PROTO3 "BUILD_PROTO3" ON)
|
||||
INCLUDE(TestBigEndian)
|
||||
TEST_BIG_ENDIAN(WORDS_BIGENDIAN)
|
||||
|
||||
+
|
||||
+IF(CMAKE_HOST_UNIX)
|
||||
+ FIND_PACKAGE(Threads REQUIRED)
|
||||
+ENDIF()
|
||||
+
|
||||
SET(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
|
||||
ADD_DEFINITIONS(-DPACKAGE_VERSION="${PACKAGE_VERSION}")
|
||||
ADD_DEFINITIONS(-DPACKAGE_STRING="${PACKAGE_STRING}")
|
||||
@@ -67,6 +72,9 @@ FILE(GLOB PROTOC_GEN_C_SRC ${MAIN_DIR}/protoc-c/*.h ${MAIN_DIR}/protoc-c/*.cc )
|
||||
ADD_EXECUTABLE(protoc-gen-c ${PROTOC_GEN_C_SRC})
|
||||
|
||||
TARGET_LINK_LIBRARIES(protoc-gen-c ${PROTOBUF_PROTOC_LIBRARY} ${PROTOBUF_LIBRARY})
|
||||
+IF(CMAKE_HOST_UNIX)
|
||||
+ TARGET_LINK_LIBRARIES(protoc-gen-c ${CMAKE_THREAD_LIBS_INIT})
|
||||
+ENDIF()
|
||||
ENDIF()
|
||||
|
||||
IF(WITH_TEST AND WITH_TOOLS)
|
||||
@@ -99,6 +107,9 @@ GENERATE_TEST_SOURCES(${TEST_DIR}/test-full.proto t/test-full.pb-c.c t/test-full
|
||||
|
||||
ADD_EXECUTABLE(cxx-generate-packed-data ${TEST_DIR}/generated-code2/cxx-generate-packed-data.cc t/test-full.pb.h t/test-full.pb.cc)
|
||||
TARGET_LINK_LIBRARIES(cxx-generate-packed-data ${PROTOBUF_LIBRARY})
|
||||
+IF (CMAKE_HOST_UNIX)
|
||||
+ TARGET_LINK_LIBRARIES(cxx-generate-packed-data ${CMAKE_THREAD_LIBS_INIT})
|
||||
+ENDIF()
|
||||
|
||||
FILE(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/t/generated-code2)
|
||||
ADD_CUSTOM_COMMAND(OUTPUT t/generated-code2/test-full-cxx-output.inc
|
@ -1,32 +1,42 @@
|
||||
vcpkg_fail_port_install(MESSAGE "${PORT} currently only supports Linux platform" ON_TARGET "Windows")
|
||||
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO protobuf-c/protobuf-c
|
||||
REF 1390409f4ee4e26d0635310995b516eb702c3f9e #1.3.2
|
||||
SHA512 5c60883c4ef064c641875bfe7f89bf255a29dd20b5e0be5878cbaec03f2efd1f926c3e40dc0090cb172b8eef227fddafe86051f08edb3e1c26d0bd6aca673e41
|
||||
REF v1.4.0
|
||||
SHA512 cba4c6116c0f2ebb034236e8455d493bfaa2517733befcd87b6f8d6d3df0c0149b17fcbf59cd1763fa2318119c664d0dae3d2d3a46ebfe2a0fec3ef4719b033b
|
||||
HEAD_REF master
|
||||
PATCHES
|
||||
fix-features.patch
|
||||
fix-usage-issue.patch
|
||||
fix-crt-linkage.patch
|
||||
)
|
||||
|
||||
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
||||
tools WITH_TOOLS
|
||||
test WITH_TEST
|
||||
FEATURES
|
||||
tools BUILD_PROTOC
|
||||
test BUILD_TESTS
|
||||
)
|
||||
|
||||
vcpkg_configure_cmake(
|
||||
SOURCE_PATH ${SOURCE_PATH}/build-cmake
|
||||
PREFER_NINJA
|
||||
vcpkg_cmake_configure(
|
||||
SOURCE_PATH "${SOURCE_PATH}/build-cmake"
|
||||
DISABLE_PARALLEL_CONFIGURE
|
||||
OPTIONS ${FEATURE_OPTIONS}
|
||||
)
|
||||
|
||||
vcpkg_install_cmake()
|
||||
vcpkg_cmake_install(ADD_BIN_TO_PATH)
|
||||
vcpkg_fixup_pkgconfig()
|
||||
vcpkg_copy_pdbs()
|
||||
|
||||
if("tools" IN_LIST FEATURES)
|
||||
vcpkg_copy_tools(
|
||||
TOOL_NAMES protoc-gen-c
|
||||
AUTO_CLEAN
|
||||
)
|
||||
endif()
|
||||
|
||||
# Include files should not be duplicated into the /debug/include directory.
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
||||
|
||||
# Remove duplicate PDB files (vcpkg_copy_pdbs already copied them to "bin")
|
||||
file(REMOVE "${CURRENT_PACKAGES_DIR}/lib/protobuf-c.pdb")
|
||||
file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/lib/protobuf-c.pdb")
|
||||
|
||||
# Handle copyright
|
||||
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
|
||||
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|
@ -1,15 +1,18 @@
|
||||
{
|
||||
"name": "protobuf-c",
|
||||
"version-string": "1.3.2",
|
||||
"port-version": 3,
|
||||
"version-semver": "1.4.0",
|
||||
"description": "This is protobuf-c, a C implementation of the Google Protocol Buffers data serialization format.",
|
||||
"homepage": "https://github.com/protobuf-c/protobuf-c",
|
||||
"dependencies": [
|
||||
"protobuf"
|
||||
"protobuf",
|
||||
{
|
||||
"name": "vcpkg-cmake",
|
||||
"host": true
|
||||
}
|
||||
],
|
||||
"features": {
|
||||
"test": {
|
||||
"description": "build test project.",
|
||||
"description": "Build test project.",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "protobuf-c",
|
||||
@ -20,7 +23,7 @@
|
||||
]
|
||||
},
|
||||
"tools": {
|
||||
"description": "build tools."
|
||||
"description": "Build tools (protoc-gen-c)."
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1179,13 +1179,6 @@ poppler:arm64-windows=fail
|
||||
portable-snippets:arm-uwp=fail
|
||||
pqp:arm-uwp=fail
|
||||
pqp:x64-uwp=fail
|
||||
protobuf-c:x86-windows=fail
|
||||
protobuf-c:x64-windows=fail
|
||||
protobuf-c:x64-windows-static=fail
|
||||
protobuf-c:x64-windows-static-md=fail
|
||||
protobuf-c:x64-uwp=fail
|
||||
protobuf-c:arm64-windows=fail
|
||||
protobuf-c:arm-uwp=fail
|
||||
python2:arm64-windows=fail
|
||||
python2:arm-uwp=fail
|
||||
python2:x64-uwp=fail
|
||||
|
@ -5381,8 +5381,8 @@
|
||||
"port-version": 0
|
||||
},
|
||||
"protobuf-c": {
|
||||
"baseline": "1.3.2",
|
||||
"port-version": 3
|
||||
"baseline": "1.4.0",
|
||||
"port-version": 0
|
||||
},
|
||||
"protopuf": {
|
||||
"baseline": "2.1.0",
|
||||
|
@ -1,5 +1,10 @@
|
||||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "649c1df0b6207662ec75fed4bbd999a7a42afb4b",
|
||||
"version-semver": "1.4.0",
|
||||
"port-version": 0
|
||||
},
|
||||
{
|
||||
"git-tree": "7786538f69991494262bd14f710e2dd8c6062bea",
|
||||
"version-string": "1.3.2",
|
||||
|
Loading…
Reference in New Issue
Block a user