mirror of
https://github.com/XRPLF/clio.git
synced 2026-04-29 15:37:53 +00:00
61 lines
1.3 KiB
C++
61 lines
1.3 KiB
C++
#include <ripple/beast/core/SemanticVersion.h>
|
|
#include <boost/preprocessor/stringize.hpp>
|
|
#include <algorithm>
|
|
#include <main/Build.h>
|
|
#include <optional>
|
|
#include <stdexcept>
|
|
|
|
namespace Build {
|
|
|
|
//--------------------------------------------------------------------------
|
|
// The build version number. You must edit this for each release
|
|
// and follow the format described at http://semver.org/
|
|
//------------------------------------------------------------------------------
|
|
// clang-format off
|
|
char const* const versionString = "1.0.3"
|
|
// clang-format on
|
|
|
|
"+"
|
|
#ifdef CLIO_BUILD
|
|
CLIO_BUILD
|
|
#endif
|
|
#ifdef DEBUG
|
|
".DEBUG"
|
|
#ifdef SANITIZER
|
|
"."
|
|
#endif
|
|
#endif
|
|
|
|
#ifdef SANITIZER
|
|
BOOST_PP_STRINGIZE(SANITIZER)
|
|
#endif
|
|
|
|
#ifdef PKG
|
|
"-release"
|
|
#endif
|
|
|
|
//--------------------------------------------------------------------------
|
|
;
|
|
|
|
std::string const&
|
|
getClioVersionString()
|
|
{
|
|
static std::string const value = [] {
|
|
std::string const s = versionString;
|
|
beast::SemanticVersion v;
|
|
if (!v.parse(s) || v.print() != s)
|
|
throw std::runtime_error(s + ": Bad server version string");
|
|
return s;
|
|
}();
|
|
return value;
|
|
}
|
|
|
|
std::string const&
|
|
getClioFullVersionString()
|
|
{
|
|
static std::string const value = "clio-" + getClioVersionString();
|
|
return value;
|
|
}
|
|
|
|
} // namespace Build
|