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

cmake: Set correct sonames for libprotobuf-lite.so and libprotoc.so (#8635) #9529

Merged
merged 1 commit into from Feb 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions cmake/libprotobuf-lite.cmake
Expand Up @@ -108,6 +108,7 @@ if(protobuf_BUILD_SHARED_LIBS)
endif()
set_target_properties(libprotobuf-lite PROPERTIES
VERSION ${protobuf_VERSION}
SOVERSION 30
OUTPUT_NAME ${LIB_PREFIX}protobuf-lite
DEBUG_POSTFIX "${protobuf_DEBUG_POSTFIX}")
add_library(protobuf::libprotobuf-lite ALIAS libprotobuf-lite)
1 change: 0 additions & 1 deletion cmake/libprotobuf.cmake
Expand Up @@ -125,7 +125,6 @@ if(protobuf_BUILD_SHARED_LIBS)
endif()
set_target_properties(libprotobuf PROPERTIES
VERSION ${protobuf_VERSION}
# Use only the first SO version component for compatibility with Makefile emitted SONAME.
SOVERSION 30
OUTPUT_NAME ${LIB_PREFIX}protobuf
DEBUG_POSTFIX "${protobuf_DEBUG_POSTFIX}")
Expand Down
1 change: 1 addition & 0 deletions cmake/libprotoc.cmake
Expand Up @@ -140,6 +140,7 @@ endif()
set_target_properties(libprotoc PROPERTIES
COMPILE_DEFINITIONS LIBPROTOC_EXPORTS
VERSION ${protobuf_VERSION}
SOVERSION 30
OUTPUT_NAME ${LIB_PREFIX}protoc
DEBUG_POSTFIX "${protobuf_DEBUG_POSTFIX}")
add_library(protobuf::libprotoc ALIAS libprotoc)
16 changes: 11 additions & 5 deletions update_version.py
Expand Up @@ -103,11 +103,17 @@ def RewriteTextFile(filename, line_rewriter):


def UpdateCMake():
RewriteTextFile('cmake/libprotobuf.cmake',
lambda line : re.sub(
r'SOVERSION [0-9]+\.[0-9]+(\.[0-9]+)?',
'SOVERSION %s' % GetSharedObjectVersion()[0],
line))
cmake_files = (
'cmake/libprotobuf.cmake',
'cmake/libprotobuf-lite.cmake',
'cmake/libprotoc.cmake'
)
for cmake_file in cmake_files:
RewriteTextFile(cmake_file,
lambda line : re.sub(
r'SOVERSION [0-9]+\.[0-9]+(\.[0-9]+)?',
'SOVERSION %s' % GetSharedObjectVersion()[0],
line))


def UpdateConfigure():
Expand Down