mirror of
https://github.com/oxen-io/lokinet.git
synced 2024-10-29 11:05:43 +00:00
638fb25b47
This rewrites the version info using lokid's approach of compiling it into a .cpp file that gets generated as part of the build (*not* during the configure stage). Among other things, this means that changing the version no longer invalidates ccache or cmake dependencies, and because it depends on `.git/index` git commits will cause the version to be regenerated, making the commit tag more reliable (currently if you rebuild without running cmake your git commit tag doesn't update).
20 lines
785 B
C++
20 lines
785 B
C++
#include <constants/version.hpp>
|
|
#include <constants/version.h>
|
|
|
|
#define LLARP_STRINGIFY2(val) #val
|
|
#define LLARP_STRINGIFY(val) LLARP_STRINGIFY2(val)
|
|
|
|
#define LLARP_VERSION_STR LLARP_STRINGIFY(LLARP_VERSION_MAJ) "." LLARP_STRINGIFY(LLARP_VERSION_MIN) "." LLARP_STRINGIFY(LLARP_VERSION_PATCH)
|
|
#define LLARP_VERSION_FULL LLARP_VERSION_STR "-@VERSIONTAG@"
|
|
|
|
namespace llarp
|
|
{
|
|
const std::array<uint16_t, 3> VERSION{{LLARP_VERSION_MAJ, LLARP_VERSION_MIN, LLARP_VERSION_PATCH}};
|
|
const char* const VERSION_STR = LLARP_VERSION_STR;
|
|
const char* const VERSION_TAG = "@VERSIONTAG@";
|
|
const char* const VERSION_FULL = LLARP_NAME "-" LLARP_VERSION_STR "-@VERSIONTAG@";
|
|
|
|
const char* const RELEASE_MOTTO = LLARP_RELEASE_MOTTO;
|
|
const char* const DEFAULT_NETID = LLARP_DEFAULT_NETID;
|
|
}
|