summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2019-02-13 23:56:40 +0000
committerEdward Thomson <ethomson@edwardthomson.com>2019-02-14 11:57:05 +0000
commitdcf81cdbcc1b8be991433c53e6e1b12c94ef782b (patch)
tree0d5979515059fefc546253f31d11abfadfce83de
parent24ac9e0c97ff9f20d096b4d93663276bc8bb2de1 (diff)
downloadlibgit2-dcf81cdbcc1b8be991433c53e6e1b12c94ef782b.tar.gz
deprecation: optionally enable hard deprecation
Add a CMake option to enable hard deprecation; the resultant library will _not_ include any deprecated functions. This may be useful for internal CI builds that create libraries that are not shared with end-users to ensure that we do not use deprecated bits internally.
-rw-r--r--CMakeLists.txt5
1 files changed, 5 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 73702ee1e..88eb9ec10 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -64,6 +64,7 @@ OPTION(USE_EXT_HTTP_PARSER "Use system HTTP_Parser if available" ON)
OPTION(DEBUG_POOL "Enable debug pool allocator" OFF)
OPTION(ENABLE_WERROR "Enable compilation with -Werror" OFF)
OPTION(USE_BUNDLED_ZLIB "Use the bundled version of zlib" OFF)
+OPTION(DEPRECATE_HARD "Do not include deprecated functions in the library" OFF)
IF (UNIX AND NOT APPLE)
OPTION(ENABLE_REPRODUCIBLE_BUILDS "Enable reproducible builds" OFF)
@@ -105,6 +106,10 @@ SET(LIBGIT2_VERSION_STRING "${LIBGIT2_VERSION_MAJOR}.${LIBGIT2_VERSION_MINOR}.${
FILE(STRINGS "${libgit2_SOURCE_DIR}/include/git2/version.h" GIT2_HEADER_SOVERSION REGEX "^#define LIBGIT2_SOVERSION [0-9]+$")
STRING(REGEX REPLACE "^.*LIBGIT2_SOVERSION ([0-9]+)$" "\\1" LIBGIT2_SOVERSION "${GIT2_HEADER_SOVERSION}")
+IF (DEPRECATE_HARD)
+ ADD_DEFINITIONS(-DGIT_DEPRECATE_HARD)
+ENDIF()
+
# Platform specific compilation flags
IF (MSVC)
IF (STDCALL)