Rework versioning to include git rev in snap version

This commit is contained in:
Simon Fels 2017-06-03 14:02:04 +02:00
commit dc21069ae1
4 changed files with 15 additions and 14 deletions

View file

@ -25,9 +25,9 @@ namespace build {
static std::string init_version_string() {
std::string v;
if (!version_suffix || std::strlen(version_suffix) == 0)
v = utils::string_format("%d", version_major);
v = utils::string_format("%s", version);
else
v = utils::string_format("%d-%s", version_major, version_suffix);
v = utils::string_format("%s-%s", version, version_suffix);
return v;
}

View file

@ -25,8 +25,8 @@
namespace anbox {
namespace build {
/// @brief version_major marks the major version
static constexpr const std::uint32_t version_major{@ANBOX_VERSION@};
/// @brief version marks the version
static constexpr const char *version{"@ANBOX_VERSION@"};
/// @brief version_suffix is an additional suffix which can be amended to
/// the major version number to indicate a dev build for example.
static constexpr const char *version_suffix{"@ANBOX_VERSION_SUFFIX@"};