Skip to content

Commit 92ebbe9

Browse files
author
Vicent Martí
committed
Merge pull request nodegit#1399 from nathan-osman/development
Add SONAME build option to facilitate building for Android.
2 parents 6f83a78 + e7da9ac commit 92ebbe9

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 )
@@ -264,8 +265,10 @@ TARGET_OS_LIBRARIES(git2)
264265

265266
MSVC_SPLIT_SOURCES(git2)
266267

267-
SET_TARGET_PROPERTIES(git2 PROPERTIES VERSION ${LIBGIT2_VERSION_STRING})
268-
SET_TARGET_PROPERTIES(git2 PROPERTIES SOVERSION ${LIBGIT2_VERSION_MAJOR})
268+
IF (SONAME)
269+
SET_TARGET_PROPERTIES(git2 PROPERTIES VERSION ${LIBGIT2_VERSION_STRING})
270+
SET_TARGET_PROPERTIES(git2 PROPERTIES SOVERSION ${LIBGIT2_VERSION_MAJOR})
271+
ENDIF()
269272
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/libgit2.pc.in ${CMAKE_CURRENT_BINARY_DIR}/libgit2.pc @ONLY)
270273

271274
IF (MSVC_IDE)

0 commit comments

Comments
 (0)