Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9980767

Browse files
committed
Change SOVERSION at API breaks
Since the SOVERSION doesn't need to follow the library's version and simply needs to be monotonically increasing whenever we release something that breaks the ABI, we can set some number and allow multiple versions of the library to be installed side-by-side. We start here with the minor version as that's what we release for now, and it allows to backport this change to earlier versions.
1 parent ce5e661 commit 9980767

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,9 @@ STRING(REGEX REPLACE "^.*LIBGIT2_VERSION \"[0-9]+\\.([0-9]+).*$" "\\1" LIBGIT2_V
127127
STRING(REGEX REPLACE "^.*LIBGIT2_VERSION \"[0-9]+\\.[0-9]+\\.([0-9]+).*$" "\\1" LIBGIT2_VERSION_REV "${GIT2_HEADER}")
128128
SET(LIBGIT2_VERSION_STRING "${LIBGIT2_VERSION_MAJOR}.${LIBGIT2_VERSION_MINOR}.${LIBGIT2_VERSION_REV}")
129129

130+
FILE(STRINGS "include/git2/version.h" GIT2_HEADER_SOVERSION REGEX "^#define LIBGIT2_SOVERSION [0-9]+$")
131+
STRING(REGEX REPLACE "^.*LIBGIT2_SOVERSION ([0-9]+)$" "\\1" LIBGIT2_SOVERSION "${GIT2_HEADER_SOVERSION}")
132+
130133
# Find required dependencies
131134
INCLUDE_DIRECTORIES(src include)
132135

@@ -397,7 +400,7 @@ MSVC_SPLIT_SOURCES(git2)
397400

398401
IF (SONAME)
399402
SET_TARGET_PROPERTIES(git2 PROPERTIES VERSION ${LIBGIT2_VERSION_STRING})
400-
SET_TARGET_PROPERTIES(git2 PROPERTIES SOVERSION ${LIBGIT2_VERSION_MAJOR})
403+
SET_TARGET_PROPERTIES(git2 PROPERTIES SOVERSION ${LIBGIT2_SOVERSION})
401404
IF (LIBGIT2_FILENAME)
402405
ADD_DEFINITIONS(-DLIBGIT2_FILENAME=\"${LIBGIT2_FILENAME}\")
403406
SET_TARGET_PROPERTIES(git2 PROPERTIES OUTPUT_NAME ${LIBGIT2_FILENAME})

include/git2/version.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,6 @@
1212
#define LIBGIT2_VER_MINOR 20
1313
#define LIBGIT2_VER_REVISION 0
1414

15+
#define LIBGIT2_SOVERSION 20
16+
1517
#endif

0 commit comments

Comments
 (0)