Skip to content

Commit e7da9ac

Browse files
committed
Added build option SONAME to control whether VERSION and SOVERSION were set for the git2 target, as some platforms require that this NOT be set.
1 parent 9952f24 commit e7da9ac

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

CMakeLists.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
1616

1717
# Build options
1818
#
19+
OPTION( SONAME "Set the (SO)VERSION of the target" ON )
1920
OPTION( BUILD_SHARED_LIBS "Build Shared Library (OFF for Static)" ON )
2021
OPTION( THREADSAFE "Build libgit2 as threadsafe" OFF )
2122
OPTION( BUILD_CLAR "Build Tests using the Clar suite" ON )
@@ -258,8 +259,10 @@ TARGET_OS_LIBRARIES(git2)
258259

259260
MSVC_SPLIT_SOURCES(git2)
260261

261-
SET_TARGET_PROPERTIES(git2 PROPERTIES VERSION ${LIBGIT2_VERSION_STRING})
262-
SET_TARGET_PROPERTIES(git2 PROPERTIES SOVERSION ${LIBGIT2_VERSION_MAJOR})
262+
IF (SONAME)
263+
SET_TARGET_PROPERTIES(git2 PROPERTIES VERSION ${LIBGIT2_VERSION_STRING})
264+
SET_TARGET_PROPERTIES(git2 PROPERTIES SOVERSION ${LIBGIT2_VERSION_MAJOR})
265+
ENDIF()
263266
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/libgit2.pc.in ${CMAKE_CURRENT_BINARY_DIR}/libgit2.pc @ONLY)
264267

265268
IF (MSVC_IDE)

0 commit comments

Comments
 (0)