Add auto-generated Git version to window titles

This commit is contained in:
Connor McLaughlin
2020-04-17 01:56:11 +10:00
parent 610ebcf2fa
commit 277c03aca0
17 changed files with 642 additions and 8 deletions

View File

@ -25,5 +25,5 @@ if(SDL2_FOUND)
target_link_libraries(frontend-common PRIVATE ${SDL2_LIBRARIES})
endif()
target_link_libraries(frontend-common PUBLIC core common imgui simpleini)
target_link_libraries(frontend-common PUBLIC core common imgui simpleini scmversion)

View File

@ -9,6 +9,7 @@
#include "core/game_list.h"
#include "core/gpu.h"
#include "core/system.h"
#include "scmversion/scmversion.h"
#ifdef WITH_SDL2
#include "sdl_audio_stream.h"
#include "sdl_controller_interface.h"
@ -98,7 +99,7 @@ void CommonHostInterface::PowerOffSystem()
static void PrintCommandLineVersion(const char* frontend_name)
{
std::fprintf(stderr, "%s Version <TODO>\n", frontend_name);
std::fprintf(stderr, "%s Version %s (%s)\n", frontend_name, g_scm_tag_str, g_scm_branch_str);
std::fprintf(stderr, "https://github.com/stenzek/duckstation\n");
std::fprintf(stderr, "\n");
}