Commit 24a3d6db authored by Guillaume Roguez's avatar Guillaume Roguez Committed by gerrit2

api: make DRing::version() returning a git revision

This change provides a better way to find which sources are used
at runtime.

Issue: #79930
Change-Id: Icd505230269c4ba11e7d64e02471febcf68777a0
parent a58acea0
......@@ -18,6 +18,9 @@ if BUILD_GSM
GSMCODEC=-DHAVE_GSM_CODEC
endif
RING_DIRTY_REPO ?= $(shell git diff-index --quiet HEAD || echo dirty)
RING_REVISION ?= $(shell git log -1 --format="%h" --abbrev=10)
# Preprocessor flags
AM_CPPFLAGS = \
-I$(src)/src \
......@@ -29,6 +32,8 @@ AM_CPPFLAGS = \
-DPREFIX=\"$(prefix)\" \
-DPROGSHAREDIR=\"${datadir}/ring\" \
-DENABLE_TRACE \
-DRING_REVISION=\"${RING_REVISION}\" \
-DRING_DIRTY_REPO=\"${RING_DIRTY_REPO}\" \
$(SPEEXCODEC) \
$(GSMCODEC) \
$(OPUSCODEC)
......
......@@ -105,7 +105,9 @@ if USE_DHT
libring_la_CFLAGS += $(OPENDHT_CFLAGS)
endif
libring_la_SOURCES = conference.cpp \
libring_la_SOURCES = \
buildinfo.cpp \
conference.cpp \
account_factory.cpp \
call_factory.cpp \
preferences.cpp \
......@@ -168,3 +170,5 @@ if RING_VIDEO
nobase_include_HEADERS+= \
dring/videomanager_interface.h
endif
.PHONY: buildinfo.cpp
/*
* Copyright (C) 2015 Savoir-faire Linux Inc.
* Author: Guillaume Roguez <Guillaume.Roguez@savoirfairelinux.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Additional permission under GNU GPL version 3 section 7:
*
* If you modify this program, or any covered work, by linking or
* combining it with the OpenSSL project's OpenSSL library (or a
* modified version of that library), containing parts covered by the
* terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc.
* grants you additional permission to convey the resulting work.
* Corresponding Source for a non-source form of such a combination
* shall include the source code for the parts of OpenSSL used as well
* as that of the covered work.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "dring.h"
#include <string>
namespace DRing {
const char*
version() noexcept
{
return RING_DIRTY_REPO[0] ? PACKAGE_VERSION "-" RING_REVISION "-" RING_DIRTY_REPO : PACKAGE_VERSION "-" RING_REVISION;
}
} // namespace DRing
......@@ -50,12 +50,6 @@
namespace DRing {
const char*
version() noexcept
{
return PACKAGE_VERSION;
}
bool
init(enum InitFlag flags) noexcept
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment