Commit e2234ee97c929345b065fe355fe6c8d2a394f2af

Daniel Gibson 2021-05-16T06:33:29

CMake: Fix SOVERSION/SONAME of non-release versions When building SDL2 from git with CMake, you got libSDL2-2.0.so.1 instead of .0 (as it's the case when building with autotools). This was caused by using LT_REVISION instead of LT_MAJOR for SOVERSION. fixes #4310

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 07da97a..6902207 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2530,7 +2530,7 @@ if(SDL_SHARED)
   elseif(UNIX AND NOT ANDROID)
     set_target_properties(SDL2 PROPERTIES
       VERSION ${LT_VERSION}
-      SOVERSION ${LT_REVISION}
+      SOVERSION ${LT_MAJOR}
       OUTPUT_NAME "SDL2-${LT_RELEASE}")
   else()
     if(WINDOWS OR CYGWIN)