RS version is now parametrizable at compile time

Avoid the need of dirty patching to set the version at build time
In case RS version is not passed as argument attempt to determine it
  using git describe, if unavailable use hardcoded default
This commit is contained in:
Gioacchino Mazzurco 2018-09-12 00:33:29 +02:00
parent 5495f43c51
commit 92f90178c4
No known key found for this signature in database
GPG key ID: A1FBCA3872E87051
12 changed files with 126 additions and 103 deletions

View file

@ -1,37 +0,0 @@
/*******************************************************************************
* libretroshare/src/util: rsversioninfo.cc *
* *
* libretroshare: retroshare core library *
* *
* Copyright 2013-2013 by Alexandrut *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Lesser 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 Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
* *
*******************************************************************************/
#include "rsversioninfo.h"
#include "retroshare/rsversion.h"
#include "rsstring.h"
std::string RsUtil::retroshareVersion()
{
std::string version;
rs_sprintf(version, "%d.%d.%d%s Revision %08x", RS_MAJOR_VERSION, RS_MINOR_VERSION, RS_BUILD_NUMBER, RS_BUILD_NUMBER_ADD, RS_REVISION_NUMBER);
return version;
}
uint32_t RsUtil::retroshareRevision()
{
return RS_REVISION_NUMBER;
}

View file

@ -1,30 +0,0 @@
/*******************************************************************************
* libretroshare/src/util: rsversioninfo.h *
* *
* libretroshare: retroshare core library *
* *
* Copyright 2013-2013 by Alexandrut *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Lesser 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 Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
* *
*******************************************************************************/
#include <string>
#include <inttypes.h>
namespace RsUtil {
uint32_t retroshareRevision();
std::string retroshareVersion();
}