diff options
| author | Pascal Thomet <pthomet@gmail.com> | 2020-05-08 23:48:03 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-05-08 14:48:03 -0700 |
| commit | fcdac2dc15122d30e08cf9c71ae2e0e6b466f1a6 (patch) | |
| tree | 3f24a6998a931b4955fdf7e6e6818dd41e7afb3f | |
| parent | 57e65ee144d3cf2e046eab7a4ac7be2150fd6f19 (diff) | |
| download | vcpkg-fcdac2dc15122d30e08cf9c71ae2e0e6b466f1a6.tar.gz vcpkg-fcdac2dc15122d30e08cf9c71ae2e0e6b466f1a6.zip | |
[protobuf] Correct protobuf under android (Fix issue #8218) (#11228)
* Correct protobuf under android (Fix issue #8218)
- This fixes https://github.com/microsoft/vcpkg/issues/8218
The original error is linkely inside protobuf CMakeLists, which should
link the log library under Android.
See explanations here:
https://github.com/protocolbuffers/protobuf/issues/2719
* ports/protobuf/CONTROL: Version 3.11.4-1
| -rw-r--r-- | ports/protobuf/CONTROL | 2 | ||||
| -rw-r--r-- | ports/protobuf/fix-android-log.patch | 28 | ||||
| -rw-r--r-- | ports/protobuf/portfile.cmake | 1 |
3 files changed, 30 insertions, 1 deletions
diff --git a/ports/protobuf/CONTROL b/ports/protobuf/CONTROL index fee21f7b9..2385d6e32 100644 --- a/ports/protobuf/CONTROL +++ b/ports/protobuf/CONTROL @@ -1,5 +1,5 @@ Source: protobuf -Version: 3.11.4 +Version: 3.11.4-1 Homepage: https://github.com/google/protobuf Description: Protocol Buffers - Google's data interchange format diff --git a/ports/protobuf/fix-android-log.patch b/ports/protobuf/fix-android-log.patch new file mode 100644 index 000000000..47a935078 --- /dev/null +++ b/ports/protobuf/fix-android-log.patch @@ -0,0 +1,28 @@ +diff --git a/cmake/libprotobuf-lite.cmake b/cmake/libprotobuf-lite.cmake +index 6bf86a277..424854798 100644 +--- a/cmake/libprotobuf-lite.cmake ++++ b/cmake/libprotobuf-lite.cmake +@@ -67,6 +67,9 @@ target_link_libraries(libprotobuf-lite ${CMAKE_THREAD_LIBS_INIT}) + if(protobuf_LINK_LIBATOMIC) + target_link_libraries(libprotobuf-lite atomic) + endif() ++if(${CMAKE_SYSTEM_NAME} STREQUAL "Android") ++ target_link_libraries(libprotobuf-lite log) ++endif() + target_include_directories(libprotobuf-lite PUBLIC ${protobuf_source_dir}/src) + if(MSVC AND protobuf_BUILD_SHARED_LIBS) + target_compile_definitions(libprotobuf-lite +diff --git a/cmake/libprotobuf.cmake b/cmake/libprotobuf.cmake +index 0c12596c2..a5be494fb 100644 +--- a/cmake/libprotobuf.cmake ++++ b/cmake/libprotobuf.cmake +@@ -121,6 +121,9 @@ endif() + if(protobuf_LINK_LIBATOMIC) + target_link_libraries(libprotobuf atomic) + endif() ++if(${CMAKE_SYSTEM_NAME} STREQUAL "Android") ++ target_link_libraries(libprotobuf log) ++endif() + target_include_directories(libprotobuf PUBLIC ${protobuf_source_dir}/src) + if(MSVC AND protobuf_BUILD_SHARED_LIBS) + target_compile_definitions(libprotobuf diff --git a/ports/protobuf/portfile.cmake b/ports/protobuf/portfile.cmake index 4eec0669b..a5e9252ad 100644 --- a/ports/protobuf/portfile.cmake +++ b/ports/protobuf/portfile.cmake @@ -6,6 +6,7 @@ vcpkg_from_github( HEAD_REF master PATCHES fix-uwp.patch + fix-android-log.patch ) if(CMAKE_HOST_WIN32 AND NOT VCPKG_TARGET_ARCHITECTURE MATCHES "x64" AND NOT VCPKG_TARGET_ARCHITECTURE MATCHES "x86") |
