diff --git a/CMakeLists.txt b/CMakeLists.txt index c6a96ce9c9..4530fa6acd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,6 +2,12 @@ cmake_minimum_required (VERSION 3.16.3) # Oldest Ubuntu LTS (20.04 currently) project(libheif LANGUAGES C CXX VERSION 1.17.0) +# compatibility_version is never allowed to be decreased for any specific SONAME. +# Libtool in the libheif-1.15.1 release had set it to 17.0.0, so we have to use this for the v1.x.y versions. +# With v2.0.0, we can reset this to more closely follow the real version name, i.e. "2.0.0". +# CMake 3.17.0 added "MACHO_COMPATIBILITY_VERSION", but we are currently stuck at cmake 3.16.3. +set(MACOS_COMPATIBLE_VERSION "17.0.0") + # https://cmake.org/cmake/help/v3.1/policy/CMP0054.html cmake_policy(VERSION 3.0...3.22) include(GNUInstallDirs) diff --git a/libheif/CMakeLists.txt b/libheif/CMakeLists.txt index ecf1ddd9c7..93c65be39f 100644 --- a/libheif/CMakeLists.txt +++ b/libheif/CMakeLists.txt @@ -100,13 +100,10 @@ set_target_properties(heif VERSION ${PROJECT_VERSION} SOVERSION ${PROJECT_VERSION_MAJOR}) -# compatibility_version defaults to 1.0.0 and is never allowed to be -# decreased for any specific SONAME. Libtool in the libheif-1.15.1 -# release had set it to 17.0.0, so force it higher here. if (APPLE) set_target_properties(heif PROPERTIES - LINK_FLAGS "-Wl,-compatibility_version,18.0.0") + LINK_FLAGS "-Wl,-compatibility_version,${MACOS_COMPATIBLE_VERSION}") endif () target_compile_definitions(heif