Remove global GIT_COMMIT_HASH define, use GitVersionHash global var

* On windows, the change in a global GIT_COMMIT_HASH define in each
  project needing it meant a full rebuild every time the commit changed.
* Ideally we'd set the define only on one file in each project, but
  MSBuild doesn't seem to support that. Instead we make a new tiny
  project that compiles a single cpp exporting a global var, and
  reference that global var in each other project.
This commit is contained in:
baldurk
2018-01-16 20:17:53 +00:00
parent 654fa1bb6c
commit dea21b20a0
18 changed files with 158 additions and 39 deletions
+5 -6
View File
@@ -34,7 +34,7 @@ AboutDialog::AboutDialog(QWidget *parent) : QDialog(parent), ui(new Ui::AboutDia
{
ui->setupUi(this);
QString hash = lit(GIT_COMMIT_HASH);
QString hash = QString::fromLatin1(GitVersionHash);
if(hash[0] == QLatin1Char('N') && hash[1] == QLatin1Char('O'))
{
@@ -43,11 +43,10 @@ AboutDialog::AboutDialog(QWidget *parent) : QDialog(parent), ui(new Ui::AboutDia
}
else
{
ui->version->setText(
QFormatStr("Version %1 (built from <a href='%2'>%3</a>)")
.arg(lit(FULL_VERSION_STRING))
.arg(lit("https://github.com/baldurk/renderdoc/commit/" GIT_COMMIT_HASH))
.arg(lit(GIT_COMMIT_HASH).left(8)));
ui->version->setText(QFormatStr("Version %1 (built from <a href='%2'>%3</a>)")
.arg(lit(FULL_VERSION_STRING))
.arg(lit("https://github.com/baldurk/renderdoc/commit/%1").arg(hash))
.arg(hash.left(8)));
}
#if defined(DISTRIBUTION_VERSION)