Organized version information (#3781)

added new `GIT_MODIFIED` variable - used to determine whether the vcs tree was compiled or not at the time of building the app
added information about running in DEBUG mode which might be very helpful to determine whether one is running a DEBUG build, e.g. in the process of troubleshooting/determining crash causes

Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
This commit is contained in:
Kasia
2022-06-04 21:00:42 +02:00
committed by GitHub
parent a693bc23f8
commit a7939b727f
6 changed files with 145 additions and 83 deletions
+4
View File
@@ -674,12 +674,16 @@ isEmpty(git_release) {
git_release=$$system(git describe)
}
git_hash = $$str_member($$git_commit, 0, 8)
git_modified=$$system(git status --porcelain -z)
# Passing strings as defines requires you to use this weird triple-escape then quotation mark syntax.
# https://stackoverflow.com/questions/3348711/add-a-define-to-qmake-with-a-value/18343449#18343449
DEFINES += CHATTERINO_GIT_COMMIT=\\\"$$git_commit\\\"
DEFINES += CHATTERINO_GIT_RELEASE=\\\"$$git_release\\\"
DEFINES += CHATTERINO_GIT_HASH=\\\"$$git_hash\\\"
!isEmpty(git_modified) {
DEFINES += CHATTERINO_GIT_MODIFIED
}
CONFIG(debug, debug|release) {
message("Building Chatterino2 DEBUG")