build: fix JAMI_REVISION, JAMI_DIRTY_REPO

Change-Id: I879224318b47c151db91a12c0260dea25e33553d
This commit is contained in:
Adrien Béraud
2022-11-01 16:14:39 -04:00
parent 412c301f98
commit 302e85908b
2 changed files with 11 additions and 11 deletions

View File

@ -2,8 +2,8 @@
src=$(abs_top_srcdir) src=$(abs_top_srcdir)
RING_DIRTY_REPO ?= $(shell git diff-index --quiet HEAD 2>/dev/null || echo dirty) JAMI_DIRTY_REPO ?= $(shell git diff-index --quiet HEAD 2>/dev/null || echo dirty)
RING_REVISION ?= $(shell git log -1 --format="%h" --abbrev=10 2>/dev/null) JAMI_REVISION ?= $(shell git log -1 --format="%h" --abbrev=10 2>/dev/null)
JAMI_DATADIR ?= $(datadir)/jami JAMI_DATADIR ?= $(datadir)/jami
# Preprocessor flags # Preprocessor flags
@ -17,7 +17,7 @@ AM_CPPFLAGS += \
-DPREFIX=\"$(prefix)\" \ -DPREFIX=\"$(prefix)\" \
-DJAMI_DATADIR=\"$(JAMI_DATADIR)\" \ -DJAMI_DATADIR=\"$(JAMI_DATADIR)\" \
-DENABLE_TRACE \ -DENABLE_TRACE \
-LIBJAMI_REVISION=\"$(RING_REVISION)\" \ -DJAMI_REVISION=\"$(JAMI_REVISION)\" \
-LIBJAMI_DIRTY_REPO=\"$(RING_DIRTY_REPO)\" \ -DJAMI_DIRTY_REPO=\"$(JAMI_DIRTY_REPO)\" \
-DPJSIP_MAX_PKT_LEN=8000 \ -DPJSIP_MAX_PKT_LEN=8000 \
-DPJ_AUTOCONF=1 -DPJ_AUTOCONF=1

View File

@ -27,12 +27,12 @@
#include <ciso646> // fix windows compiler bug #include <ciso646> // fix windows compiler bug
#ifndef RING_REVISION #ifndef JAMI_REVISION
#define RING_REVISION "" #define JAMI_REVISION ""
#endif #endif
#ifndef RING_DIRTY_REPO #ifndef JAMI_DIRTY_REPO
#define RING_DIRTY_REPO "" #define JAMI_DIRTY_REPO ""
#endif #endif
#ifndef PACKAGE_VERSION #ifndef PACKAGE_VERSION
@ -44,9 +44,9 @@ namespace libjami {
const char* const char*
version() noexcept version() noexcept
{ {
return RING_REVISION[0] and RING_DIRTY_REPO[0] return JAMI_REVISION[0] and JAMI_DIRTY_REPO[0]
? PACKAGE_VERSION "-" RING_REVISION "-" RING_DIRTY_REPO ? PACKAGE_VERSION "-" JAMI_REVISION "-" JAMI_DIRTY_REPO
: (RING_REVISION[0] ? PACKAGE_VERSION "-" RING_REVISION : PACKAGE_VERSION); : (JAMI_REVISION[0] ? PACKAGE_VERSION "-" JAMI_REVISION : PACKAGE_VERSION);
} }
const char* const char*