diff options
| author | Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> | 2020-05-27 13:08:00 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-05-26 22:08:00 -0700 |
| commit | 6ca5fb670a5ae70eeeae326f90d0560c935a1c11 (patch) | |
| tree | f87e4d3060c91bc51d6202f4a711ae792cf7a041 | |
| parent | 7bfd3e4b317e95ae0cf301c051d65b9c027ffdd9 (diff) | |
| download | vcpkg-6ca5fb670a5ae70eeeae326f90d0560c935a1c11.tar.gz vcpkg-6ca5fb670a5ae70eeeae326f90d0560c935a1c11.zip | |
[protobuf-c] Fix tool protoc-gen-c crash (#11517)
| -rw-r--r-- | ports/protobuf-c/CONTROL | 2 | ||||
| -rw-r--r-- | ports/protobuf-c/fix-usage-issue.patch | 36 | ||||
| -rw-r--r-- | ports/protobuf-c/portfile.cmake | 4 |
3 files changed, 40 insertions, 2 deletions
diff --git a/ports/protobuf-c/CONTROL b/ports/protobuf-c/CONTROL index dce11fd90..3f42f7e53 100644 --- a/ports/protobuf-c/CONTROL +++ b/ports/protobuf-c/CONTROL @@ -1,5 +1,5 @@ Source: protobuf-c
-Version: 1.3.2
+Version: 1.3.2-1
Homepage: https://github.com/protobuf-c/protobuf-c
Description: This is protobuf-c, a C implementation of the Google Protocol Buffers data serialization format.
Build-Depends: protobuf
diff --git a/ports/protobuf-c/fix-usage-issue.patch b/ports/protobuf-c/fix-usage-issue.patch new file mode 100644 index 000000000..ce5e4cfa2 --- /dev/null +++ b/ports/protobuf-c/fix-usage-issue.patch @@ -0,0 +1,36 @@ +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 diff --git a/ports/protobuf-c/portfile.cmake b/ports/protobuf-c/portfile.cmake index ec3bcba72..98f7035f6 100644 --- a/ports/protobuf-c/portfile.cmake +++ b/ports/protobuf-c/portfile.cmake @@ -6,7 +6,9 @@ vcpkg_from_github( REF 1390409f4ee4e26d0635310995b516eb702c3f9e #1.3.2
SHA512 5c60883c4ef064c641875bfe7f89bf255a29dd20b5e0be5878cbaec03f2efd1f926c3e40dc0090cb172b8eef227fddafe86051f08edb3e1c26d0bd6aca673e41
HEAD_REF master
- PATCHES fix-features.patch
+ PATCHES
+ fix-features.patch
+ fix-usage-issue.patch
)
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
