diff --git a/liblava/core/version.hpp b/liblava/core/version.hpp index e9fdd5b84717da13ec4c22302b9d1c83d2f97d56..47868444cd9fff0b3ec0395213ab04cd15a97ae6 100644 --- a/liblava/core/version.hpp +++ b/liblava/core/version.hpp @@ -16,8 +16,6 @@ namespace lava { auto operator<=>(internal_version const&) const = default; }; - constexpr internal_version const _internal_version = {}; - enum class version_stage { preview, alpha, @@ -33,8 +31,6 @@ namespace lava { i32 rev = 0; }; - constexpr version const _version = {}; - constexpr name _build_date = LIBLAVA_BUILD_DATE; constexpr name _build_time = LIBLAVA_BUILD_TIME; diff --git a/liblava/frame/frame.cpp b/liblava/frame/frame.cpp index d42126ddae843c0abc3272ac7cc637d86a60a4fb..704e39f6eb69902e1b220c40292645d7cc17e738 100644 --- a/liblava/frame/frame.cpp +++ b/liblava/frame/frame.cpp @@ -109,16 +109,16 @@ namespace lava { setup_log(config.log); - if (_internal_version != config.app_info.app_version) { - log()->info(">>> {} / {} - {} / {} - {} {}", str(to_string(_version)), - str(to_string(_internal_version)), - config.app_info.app_name, - str(to_string(config.app_info.app_version)), + if (internal_version{} != config.info.app_version) { + log()->info(">>> {} / {} - {} / {} - {} {}", str(version_string()), + str(internal_version_string()), + config.info.app_name, + str(to_string(config.info.app_version)), _build_date, _build_time); } else { - log()->info(">>> {} / {} - {} - {} {}", str(to_string(_version)), - str(to_string(_internal_version)), - config.app_info.app_name, + log()->info(">>> {} / {} - {} - {} {}", str(version_string()), + str(internal_version_string()), + config.info.app_name, _build_date, _build_time); } diff --git a/liblava/util/log.hpp b/liblava/util/log.hpp index 3872e0e5134ad2d91b73e2fb051cb2291e6146e6..eb685b810fc1a8efb66f1f90301cc405909b906a 100644 --- a/liblava/util/log.hpp +++ b/liblava/util/log.hpp @@ -26,6 +26,10 @@ namespace lava { return fmt::format("{}.{}.{}", version.major, version.minor, version.patch); } + inline string internal_version_string() { + return to_string(internal_version{}); + } + inline name to_string(version_stage stage) { switch (stage) { case version_stage::preview: @@ -55,6 +59,10 @@ namespace lava { return fmt::format("{}.{} {}", version.year, version.release, str(stage_str)); } + inline string version_string() { + return to_string(version{}); + } + constexpr name _lava_log_file_ = "lava.log"; struct log_config {