diff options
author | Abseil Team <absl-team@google.com> | 2024-05-31 14:31:21 -0700 |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2024-05-31 14:32:29 -0700 |
commit | d06b82773e2306a99a8971934fb5845d5c04a170 (patch) | |
tree | 6af256205759c905b44577555da97a6db6a881f1 | |
parent | 0d9746acbd4b5c0b46d299a3f0909bcc23540123 (diff) |
Move SOVERSION to global CMakeLists, apply SOVERSION to DLL
So that multiple LTS builds can co-exist.
PiperOrigin-RevId: 639154515
Change-Id: Id34d6fbef823151a4f3c73cf7b9b340257eadd63
-rw-r--r-- | CMake/AbseilDll.cmake | 5 | ||||
-rw-r--r-- | CMake/AbseilHelpers.cmake | 2 | ||||
-rw-r--r-- | CMakeLists.txt | 1 | ||||
-rwxr-xr-x | create_lts.py | 27 |
4 files changed, 20 insertions, 15 deletions
diff --git a/CMake/AbseilDll.cmake b/CMake/AbseilDll.cmake index 88e1d35f..828cc347 100644 --- a/CMake/AbseilDll.cmake +++ b/CMake/AbseilDll.cmake @@ -827,7 +827,10 @@ function(absl_make_dll) ${_dll_libs} ${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( ${_dll} PUBLIC diff --git a/CMake/AbseilHelpers.cmake b/CMake/AbseilHelpers.cmake index 44f5bb3f..70a37f11 100644 --- a/CMake/AbseilHelpers.cmake +++ b/CMake/AbseilHelpers.cmake @@ -306,7 +306,7 @@ Cflags: -I\${includedir}${PC_CFLAGS}\n") if(ABSL_ENABLE_INSTALL) set_target_properties(${_NAME} PROPERTIES OUTPUT_NAME "absl_${_NAME}" - SOVERSION 0 + SOVERSION "${ABSL_SOVERSION}" ) endif() else() diff --git a/CMakeLists.txt b/CMakeLists.txt index 56c054ef..d88283b2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -59,6 +59,7 @@ if (POLICY CMP0141) endif (POLICY CMP0141) project(absl LANGUAGES CXX) +set(ABSL_SOVERSION 0) include(CTest) # Output directory is correct by default for most build setups. However, when diff --git a/create_lts.py b/create_lts.py index 7e5368e1..c20577a7 100755 --- a/create_lts.py +++ b/create_lts.py @@ -116,20 +116,21 @@ def main(argv): datestamp) }) ReplaceStringsInFile( - 'CMakeLists.txt', { - 'project(absl LANGUAGES CXX)': + 'CMakeLists.txt', + { + 'project(absl LANGUAGES CXX)': ( 'project(absl LANGUAGES CXX VERSION {})'.format(datestamp) - }) - # 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 - # 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 - # MacOS linker requires the first part of the SOVERSION to fit into - # 16 bits. - # https://www.sicpers.info/2013/03/how-to-version-a-mach-o-library/ - ReplaceStringsInFile( - 'CMake/AbseilHelpers.cmake', - {'SOVERSION 0': 'SOVERSION "{}.0.0"'.format(datestamp[2:6])}) + ), + # 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 + # 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 + # MacOS linker requires the first part of the SOVERSION to fit into + # 16 bits. + # https://www.sicpers.info/2013/03/how-to-version-a-mach-o-library/ + 'ABSL_SOVERSION 0': 'ABSL_SOVERSION "{}.0.0"'.format(datestamp[2:6]), + }, + ) StripContentBetweenTags('CMakeLists.txt', '# absl:lts-remove-begin', '# absl:lts-remove-end') |