deprecation: define GIT_DEPRECATE_HARD internally

Ensure that we do not use any deprecated functions in the library
source, test code or examples.
This commit is contained in:
Edward Thomson
2019-01-23 00:32:40 +00:00
parent 9f3a5a64b5
commit c951b825bc
2 changed files with 5 additions and 1 deletions

View File

@@ -105,6 +105,9 @@ 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}")
# Ensure that we do not use deprecated functions internally
ADD_DEFINITIONS(-DGIT_DEPRECATE_HARD)
# Platform specific compilation flags
IF (MSVC)
IF (STDCALL)
@@ -229,7 +232,6 @@ ELSE ()
ENABLE_WARNINGS(int-conversion)
DISABLE_WARNINGS(documentation-deprecated-sync)
IF (PROFILE)
SET(CMAKE_C_FLAGS "-pg ${CMAKE_C_FLAGS}")
SET(CMAKE_EXE_LINKER_FLAGS "-pg ${CMAKE_EXE_LINKER_FLAGS}")

View File

@@ -1,3 +1,5 @@
#undef GIT_DEPRECATE_HARD
#include "clar_libgit2.h"
#include "git2/sys/stream.h"
#include "streams/tls.h"