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

Hunter 27.1 #6

Open
wants to merge 3 commits into
base: hunter-27.1
Choose a base branch
from
Open
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Android fixes from 3.19.4
ruslo authored and James Gamei committed Jun 14, 2024
commit 4b9f7c2186cef272eb6eab029f313a83f85f5a0b
11 changes: 8 additions & 3 deletions cmake/libprotobuf-lite.cmake
Original file line number Diff line number Diff line change
@@ -16,12 +16,12 @@ if(protobuf_HAVE_LD_VERSION_SCRIPT)
set_target_properties(libprotobuf-lite PROPERTIES
LINK_DEPENDS ${protobuf_SOURCE_DIR}/src/libprotobuf-lite.map)
endif()
target_link_libraries(libprotobuf-lite PRIVATE ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries(libprotobuf-lite PUBLIC ${CMAKE_THREAD_LIBS_INIT})
if(protobuf_LINK_LIBATOMIC)
target_link_libraries(libprotobuf-lite PRIVATE atomic)
target_link_libraries(libprotobuf-lite PUBLIC atomic)
endif()
if(${CMAKE_SYSTEM_NAME} STREQUAL "Android")
target_link_libraries(libprotobuf-lite PRIVATE log)
target_link_libraries(libprotobuf-lite PUBLIC log)
endif()
target_include_directories(libprotobuf-lite PUBLIC
$<BUILD_INTERFACE:${protobuf_SOURCE_DIR}/src>
@@ -46,3 +46,8 @@ set_target_properties(libprotobuf-lite PROPERTIES
add_library(protobuf::libprotobuf-lite ALIAS libprotobuf-lite)

target_link_libraries(libprotobuf-lite PRIVATE utf8_validity)

if(ANDROID)
find_package(android_log REQUIRED)
target_link_libraries(libprotobuf-lite PUBLIC android_log::android_log)
endif()
13 changes: 9 additions & 4 deletions cmake/libprotobuf.cmake
Original file line number Diff line number Diff line change
@@ -16,15 +16,15 @@ if(protobuf_HAVE_LD_VERSION_SCRIPT)
set_target_properties(libprotobuf PROPERTIES
LINK_DEPENDS ${protobuf_SOURCE_DIR}/src/libprotobuf.map)
endif()
target_link_libraries(libprotobuf PRIVATE ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries(libprotobuf PUBLIC ${CMAKE_THREAD_LIBS_INIT})
if(protobuf_WITH_ZLIB)
target_link_libraries(libprotobuf PRIVATE ${ZLIB_LIBRARIES})
target_link_libraries(libprotobuf PUBLIC ${ZLIB_LIBRARIES})
endif()
if(protobuf_LINK_LIBATOMIC)
target_link_libraries(libprotobuf PRIVATE atomic)
target_link_libraries(libprotobuf PUBLIC atomic)
endif()
if(${CMAKE_SYSTEM_NAME} STREQUAL "Android")
target_link_libraries(libprotobuf PRIVATE log)
target_link_libraries(libprotobuf PUBLIC log)
endif()
target_include_directories(libprotobuf PUBLIC
$<BUILD_INTERFACE:${protobuf_SOURCE_DIR}/src>
@@ -49,3 +49,8 @@ set_target_properties(libprotobuf PROPERTIES
add_library(protobuf::libprotobuf ALIAS libprotobuf)

target_link_libraries(libprotobuf PRIVATE utf8_validity)

if(ANDROID)
find_package(android_log REQUIRED)
target_link_libraries(libprotobuf PUBLIC android_log::android_log)
endif()
4 changes: 4 additions & 0 deletions cmake/protobuf-config.cmake.in
Original file line number Diff line number Diff line change
@@ -16,3 +16,7 @@ include("${CMAKE_CURRENT_LIST_DIR}/protobuf-generate.cmake")
if(protobuf_MODULE_COMPATIBLE)
include("${CMAKE_CURRENT_LIST_DIR}/protobuf-module.cmake")
endif()

if(ANDROID)
find_package(android_log REQUIRED)
endif()
8 changes: 8 additions & 0 deletions cmake/protobuf-module.cmake.in
Original file line number Diff line number Diff line change
@@ -126,9 +126,17 @@ _protobuf_find_libraries(Protobuf protobuf)
# The Protobuf Lite library
_protobuf_find_libraries(Protobuf_LITE protobuf-lite)

if(@protobuf_BUILD_PROTOC_BINARIES@)

# The Protobuf Protoc Library
_protobuf_find_libraries(Protobuf_PROTOC protoc)

endif()

if(UNIX)
_protobuf_find_threads()
endif()

# Set the include directory
get_target_property(Protobuf_INCLUDE_DIRS protobuf::libprotobuf
INTERFACE_INCLUDE_DIRECTORIES)