diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e48ade53376f94679330a96f6278b4cf4e3768b1..cfa9e9fbc71b9fac13423e506f52cc92371ddb7a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -63,7 +63,6 @@ set(SOURCES anbox/config.cpp anbox/not_reachable.cpp - anbox/build/version.cpp anbox/build/version.h.in anbox/android/intent.cpp diff --git a/src/anbox/build/version.cpp b/src/anbox/build/version.cpp deleted file mode 100644 index b63b804322090e90c72a923b023ffb9231171def..0000000000000000000000000000000000000000 --- a/src/anbox/build/version.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (C) 2017 Simon Fels - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 3, as published - * by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranties of - * MERCHANTABILITY, SATISFACTORY QUALITY, 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, see . - * - */ - -#include "anbox/build/version.h" -#include "anbox/utils.h" - -#include - -namespace anbox { -namespace build { -static std::string init_version_string() { - std::string v; - if (!version_suffix || std::strlen(version_suffix) == 0) - v = utils::string_format("%s", version); - else - v = utils::string_format("%s-%s", version, version_suffix); - return v; -} - -std::string print_version() { - static const std::string v{init_version_string()}; - return v; -} -} // namespace build -} // namespace anbox diff --git a/src/anbox/build/version.h.in b/src/anbox/build/version.h.in index fb7983a36f84c8a8f8fa7288a3ab4806ace1ff76..14c5397e73831c2cc5e8891281d5a9049328c375 100644 --- a/src/anbox/build/version.h.in +++ b/src/anbox/build/version.h.in @@ -27,11 +27,6 @@ namespace anbox { namespace build { /// @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@"}; -/// @brief version queries the version of Anbox -std::string print_version(); } // namespace build } // namespace anbox diff --git a/src/anbox/cmds/system_info.cpp b/src/anbox/cmds/system_info.cpp index e8f7443a0902213c4df042f520663edcc51db2d8..051f3ce8eab3f1165c78b3b973a2e72bf4721525 100644 --- a/src/anbox/cmds/system_info.cpp +++ b/src/anbox/cmds/system_info.cpp @@ -53,7 +53,7 @@ class SystemInformation { std::stringstream s; s << "version: " - << anbox::build::print_version() + << anbox::build::version << std::endl; if (anbox::utils::is_env_set("SNAP_REVISION")) { diff --git a/src/anbox/cmds/version.cpp b/src/anbox/cmds/version.cpp index d8aef39e18ce52978f0e1a783b97d653231b9525..6fea8f9e21943f7291d34b4aaac539f020ce0fbe 100644 --- a/src/anbox/cmds/version.cpp +++ b/src/anbox/cmds/version.cpp @@ -26,7 +26,7 @@ anbox::cmds::Version::Version() cli::Name{"version"}, cli::Usage{"version"}, cli::Description{"print the version of the daemon"}} { action([](const cli::Command::Context& ctxt) { - ctxt.cout << "anbox " << build::print_version() << std::endl; + ctxt.cout << "anbox " << build::version << std::endl; return 0; }); }