From 71d5f510c639de72271bac8f260fe15838023419 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 29 Nov 2022 11:57:19 -0800 Subject: [PATCH] Fixed dylib generation on macOS We just build libSDL3.dylib instead of libSDL3.0.0.0.dylib with symlinks Fixed the compatiblity vs current version, e.g. SDL 3.20.87 @rpath/libSDL3.0.dylib (compatibility version 2001.0.0, current version 2001.87.0) SDL 3.21.5 @rpath/libSDL3.dylib (compatibility version 2106.0.0, current version 2106.0.0) --- CMakeLists.txt | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4083a00c8..c2ca41a4c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -98,18 +98,18 @@ set(SDL_SO_VERSION_MICRO "${SDL_MICRO_VERSION}") set(SDL_SO_VERSION "${SDL_SO_VERSION_MAJOR}.${SDL_SO_VERSION_MINOR}.${SDL_SO_VERSION_MICRO}") if(SDL_MINOR_VERSION MATCHES "[02468]$") - math(EXPR SDL_DYLIB_CURRENT_VERSION_MAJOR "100 * ${SDL_MINOR_VERSION} + 1") - set(SDL_DYLIB_CURRENT_VERSION_MINOR "0") - math(EXPR SDL_DYLIB_COMPAT_VERSION_MAJOR "${SDL_DYLIB_CURRENT_VERSION_MAJOR}") - set(SDL_DYLIB_COMPAT_VERSION_MINOR "${SDL_MICRO_VERSION}") -else() - math(EXPR SDL_DYLIB_CURRENT_VERSION_MAJOR "100 * ${SDL_MINOR_VERSION} + ${SDL_MICRO_VERSION} + 1") - set(SDL_DYLIB_CURRENT_VERSION_MINOR "0") - math(EXPR SDL_DYLIB_COMPAT_VERSION_MAJOR "${SDL_DYLIB_CURRENT_VERSION_MAJOR}") + math(EXPR SDL_DYLIB_COMPAT_VERSION_MAJOR "100 * ${SDL_MINOR_VERSION} + 1") set(SDL_DYLIB_COMPAT_VERSION_MINOR "0") + math(EXPR SDL_DYLIB_CURRENT_VERSION_MAJOR "${SDL_DYLIB_COMPAT_VERSION_MAJOR}") + set(SDL_DYLIB_CURRENT_VERSION_MINOR "${SDL_MICRO_VERSION}") +else() + math(EXPR SDL_DYLIB_COMPAT_VERSION_MAJOR "100 * ${SDL_MINOR_VERSION} + ${SDL_MICRO_VERSION} + 1") + set(SDL_DYLIB_COMPAT_VERSION_MINOR "0") + math(EXPR SDL_DYLIB_CURRENT_VERSION_MAJOR "${SDL_DYLIB_COMPAT_VERSION_MAJOR}") + set(SDL_DYLIB_CURRENT_VERSION_MINOR "0") endif() -set(SDL_DYLIB_CURRENT_VERSION_MICRO "0") set(SDL_DYLIB_COMPAT_VERSION_MICRO "0") +set(SDL_DYLIB_CURRENT_VERSION_MICRO "0") set(SDL_DYLIB_CURRENT_VERSION "${SDL_DYLIB_CURRENT_VERSION_MAJOR}.${SDL_DYLIB_CURRENT_VERSION_MINOR}.${SDL_DYLIB_CURRENT_VERSION_MICRO}") set(SDL_DYLIB_COMPAT_VERSION "${SDL_DYLIB_COMPAT_VERSION_MAJOR}.${SDL_DYLIB_COMPAT_VERSION_MINOR}.${SDL_DYLIB_COMPAT_VERSION_MICRO}") @@ -3190,10 +3190,8 @@ if(SDL_SHARED) endif() endif() if(APPLE) - # FIXME: Remove SOVERSION in SDL3 set_target_properties(SDL3 PROPERTIES - MACOSX_RPATH 1 - SOVERSION "0") + MACOSX_RPATH 1) elseif(UNIX AND NOT ANDROID) set_target_properties(SDL3 PROPERTIES VERSION "${SDL_SO_VERSION}"