Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[protobuf] Enable Android/iOS cross building
- Loading branch information
1 parent
60a672d
commit 6a14a09
Showing
6 changed files
with
58 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
recipes/protobuf/all/patches/upstream-pr-7288-android-log.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
https://github.com/protocolbuffers/protobuf/pull/7288 | ||
--- 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 | ||
|
||
--- 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 |
11 changes: 11 additions & 0 deletions
11
recipes/protobuf/all/patches/upstream-pr-8301-bundle-destination.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- a/cmake/install.cmake | ||
+++ b/cmake/install.cmake | ||
@@ -30,7 +30,7 @@ endforeach() | ||
|
||
if (protobuf_BUILD_PROTOC_BINARIES) | ||
install(TARGETS protoc EXPORT protobuf-targets | ||
- RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT protoc) | ||
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} BUNDLE DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT protoc) | ||
if (UNIX AND NOT APPLE) | ||
set_property(TARGET protoc | ||
PROPERTY INSTALL_RPATH "$ORIGIN/../${CMAKE_INSTALL_LIBDIR}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters