diff options
author | Alan Antonuk <alan.antonuk@gmail.com> | 2023-04-30 15:30:13 +0000 |
---|---|---|
committer | Alan Antonuk <alan.antonuk@gmail.com> | 2023-04-30 08:49:11 -0700 |
commit | d2b75b093d56f5c435f5d8c6fd4ff8eb550b2245 (patch) | |
tree | 409876805a93f519ed1b8a9391025511b83bef1f | |
parent | 8889ef336d7af66fb4a0e3398db4c3701c33d3e1 (diff) | |
download | rabbitmq-c-d2b75b093d56f5c435f5d8c6fd4ff8eb550b2245.tar.gz |
Correct library versions on Mach-O platforms
Set the compatibility and current version strings on Mach-O (Apple)
platforms. The compatibility version remains the same as the SOVERSION,
the current version is SOVERSION.AGE.REVISION, which matches the
previous libtool semantics for this.
Fixes #758
Signed-off-by: GitHub <noreply@github.com>
-rw-r--r-- | CMakeLists.txt | 2 | ||||
-rw-r--r-- | librabbitmq/CMakeLists.txt | 17 |
2 files changed, 17 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index a93ade7..7d8c24d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ # Copyright 2007 - 2021, Alan Antonuk and the rabbitmq-c contributors. # SPDX-License-Identifier: mit -cmake_minimum_required(VERSION 3.12...3.18) +cmake_minimum_required(VERSION 3.17...3.26) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake) diff --git a/librabbitmq/CMakeLists.txt b/librabbitmq/CMakeLists.txt index 347c992..c08adae 100644 --- a/librabbitmq/CMakeLists.txt +++ b/librabbitmq/CMakeLists.txt @@ -90,6 +90,13 @@ if(BUILD_SHARED_LIBS) SOVERSION ${RMQ_SOVERSION} ) + if (APPLE) + set_target_properties(rabbitmq PROPERTIES + MACHO_CURRENT_VERSION ${RMQ_SOVERSION}.${RMQ_SOVERSION_AGE}.${RMQ_SOVERSION_REVISION} + MACHO_COMPATIBILITY_VERSION ${RMQ_SOVERSION} + ) + endif() + if (WIN32) set_target_properties(rabbitmq PROPERTIES OUTPUT_NAME rabbitmq.${RMQ_SOVERSION}) endif() @@ -129,7 +136,15 @@ if(BUILD_STATIC_LIBS) set_target_properties(rabbitmq-static PROPERTIES VERSION ${RMQ_VERSION} - SOVERSION ${RMQ_SOVERSION}) + SOVERSION ${RMQ_SOVERSION} + ) + + if (APPLE) + set_target_properties(rabbitmq PROPERTIES + MACHO_CURRENT_VERSION ${RMQ_SOVERSION}.${RMQ_SOVERSION_AGE}.${RMQ_SOVERSION_REVISION} + MACHO_COMPATIBILITY_VERSION ${RMQ_SOVERSION} + ) + endif() if (WIN32) set_target_properties(rabbitmq-static PROPERTIES OUTPUT_NAME librabbitmq.${RMQ_SOVERSION}) |