Make version control info available at run-time

This commit is contained in:
Nicolas Mailloux 2022-02-21 00:01:03 -05:00
parent 0302d580db
commit 4aa7f8f59a
2 changed files with 13 additions and 0 deletions

View file

@ -506,6 +506,8 @@ namespace {
string_checkconfig_ro("/external_root/opt/isa/version"); string_checkconfig_ro("/external_root/opt/isa/version");
global::systemInfoText.append(checkconfig_str_val); global::systemInfoText.append(checkconfig_str_val);
global::systemInfoText.append("</b>"); global::systemInfoText.append("</b>");
global::systemInfoText.append("<br><b>Git:</b> ");
global::systemInfoText.append(GIT_VERSION);
global::systemInfoText.append("<br><b>Device UID:</b> "); global::systemInfoText.append("<br><b>Device UID:</b> ");
global::systemInfoText.append(deviceUID); global::systemInfoText.append(deviceUID);
global::systemInfoText.append("<br><b>Kernel version:</b> "); global::systemInfoText.append("<br><b>Kernel version:</b> ");

View file

@ -6,6 +6,17 @@ CONFIG += c++11 c++17
QMAKE_CXXFLAGS += -Wno-unused-function -Wno-unused-parameter QMAKE_CXXFLAGS += -Wno-unused-function -Wno-unused-parameter
# Thanks to https://github.com/mrbindraw/TestVersion/blob/master/TestVersion.pro
GIT_VERSION = $$system(git describe --always --tags)
COMMAND_REMOVE_MAKEFILES=$$quote(rm $$system_path($$OUT_PWD\Makefile*))
PRE_BUILD_TARGET = .dummyfile
updatemakefiles.target = $$PRE_BUILD_TARGET
updatemakefiles.commands = $$COMMAND_REMOVE_MAKEFILES
updatemakefiles.depends = FORCE
PRE_TARGETDEPS += $$PRE_BUILD_TARGET
QMAKE_EXTRA_TARGETS += updatemakefiles
DEFINES += GIT_VERSION=\\\"$$GIT_VERSION\\\"
# You can make your code fail to compile if it uses deprecated APIs. # You can make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line. # In order to do so, uncomment the following line.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0