Commit d06b8277 by Abseil Team Committed by Copybara-Service

Move SOVERSION to global CMakeLists, apply SOVERSION to DLL

So that multiple LTS builds can co-exist.

PiperOrigin-RevId: 639154515
Change-Id: Id34d6fbef823151a4f3c73cf7b9b340257eadd63
parent 0d9746ac
...@@ -827,7 +827,10 @@ function(absl_make_dll) ...@@ -827,7 +827,10 @@ function(absl_make_dll)
${_dll_libs} ${_dll_libs}
${ABSL_DEFAULT_LINKOPTS} ${ABSL_DEFAULT_LINKOPTS}
) )
set_property(TARGET ${_dll} PROPERTY LINKER_LANGUAGE "CXX") set_target_properties(${_dll} PROPERTIES
LINKER_LANGUAGE "CXX"
SOVERSION ${ABSL_SOVERSION}
)
target_include_directories( target_include_directories(
${_dll} ${_dll}
PUBLIC PUBLIC
......
...@@ -306,7 +306,7 @@ Cflags: -I\${includedir}${PC_CFLAGS}\n") ...@@ -306,7 +306,7 @@ Cflags: -I\${includedir}${PC_CFLAGS}\n")
if(ABSL_ENABLE_INSTALL) if(ABSL_ENABLE_INSTALL)
set_target_properties(${_NAME} PROPERTIES set_target_properties(${_NAME} PROPERTIES
OUTPUT_NAME "absl_${_NAME}" OUTPUT_NAME "absl_${_NAME}"
SOVERSION 0 SOVERSION "${ABSL_SOVERSION}"
) )
endif() endif()
else() else()
......
...@@ -59,6 +59,7 @@ if (POLICY CMP0141) ...@@ -59,6 +59,7 @@ if (POLICY CMP0141)
endif (POLICY CMP0141) endif (POLICY CMP0141)
project(absl LANGUAGES CXX) project(absl LANGUAGES CXX)
set(ABSL_SOVERSION 0)
include(CTest) include(CTest)
# Output directory is correct by default for most build setups. However, when # Output directory is correct by default for most build setups. However, when
......
...@@ -116,20 +116,21 @@ def main(argv): ...@@ -116,20 +116,21 @@ def main(argv):
datestamp) datestamp)
}) })
ReplaceStringsInFile( ReplaceStringsInFile(
'CMakeLists.txt', { 'CMakeLists.txt',
'project(absl LANGUAGES CXX)': {
'project(absl LANGUAGES CXX)': (
'project(absl LANGUAGES CXX VERSION {})'.format(datestamp) 'project(absl LANGUAGES CXX VERSION {})'.format(datestamp)
}) ),
# Set the SOVERSION to YYMM.0.0 - The first 0 means we only have ABI # Set the SOVERSION to YYMM.0.0 - The first 0 means we only have ABI
# compatible changes, and the second 0 means we can increment it to # compatible changes, and the second 0 means we can increment it to
# mark changes as ABI-compatible, for patch releases. Note that we # mark changes as ABI-compatible, for patch releases. Note that we
# only use the last two digits of the year and the month because the # only use the last two digits of the year and the month because the
# MacOS linker requires the first part of the SOVERSION to fit into # MacOS linker requires the first part of the SOVERSION to fit into
# 16 bits. # 16 bits.
# https://www.sicpers.info/2013/03/how-to-version-a-mach-o-library/ # https://www.sicpers.info/2013/03/how-to-version-a-mach-o-library/
ReplaceStringsInFile( 'ABSL_SOVERSION 0': 'ABSL_SOVERSION "{}.0.0"'.format(datestamp[2:6]),
'CMake/AbseilHelpers.cmake', },
{'SOVERSION 0': 'SOVERSION "{}.0.0"'.format(datestamp[2:6])}) )
StripContentBetweenTags('CMakeLists.txt', '# absl:lts-remove-begin', StripContentBetweenTags('CMakeLists.txt', '# absl:lts-remove-begin',
'# absl:lts-remove-end') '# absl:lts-remove-end')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment