Make Qt Creator build with -Werror=date-time

As a part of making the Qt Creator build reproducible, ensure that the
build time isn't by default encoded into the binaries.

Change-Id: I92bc3c2e832d5397bc1e2599214ef3ba911fed0b
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
This commit is contained in:
Sune Vuorela
2015-02-03 08:34:38 +01:00
parent 055c4ecb53
commit d70bdaf450
4 changed files with 18 additions and 9 deletions

View File

@@ -279,8 +279,8 @@ extern "C" HRESULT CALLBACK pid(CIDebugClient *client, PCSTR args)
int token;
commandTokens<StringList>(args, &token);
dprintf("Qt Creator CDB extension version 3.3 %d bit built %s.\n",
sizeof(void *) * 8, __DATE__);
dprintf("Qt Creator CDB extension version 3.3 %d bit.\n",
sizeof(void *) * 8);
if (const ULONG pid = currentProcessId(client))
ExtensionContext::instance().report('R', token, 0, "pid", "%u", pid);
else
@@ -940,7 +940,7 @@ extern "C" HRESULT CALLBACK setparameter(CIDebugClient *, PCSTR args)
extern "C" HRESULT CALLBACK help(CIDebugClient *, PCSTR)
{
std::ostringstream str;
str << "### Qt Creator CDB extension built " << __DATE__ << "\n\n";
str << "### Qt Creator CDB extension" << "\n\n";
const size_t commandCount = sizeof(commandDescriptions)/sizeof(CommandDescription);
std::copy(commandDescriptions, commandDescriptions + commandCount,

View File

@@ -5,6 +5,10 @@ QT += help \
script \
sql
# embedding build time information prevents repeatedly binary exact versions from same source code
isEmpty(QTC_SHOW_BUILD_DATE): QTC_SHOW_BUILD_DATE = $$(QTC_SHOW_BUILD_DATE)
!isEmpty(QTC_SHOW_BUILD_DATE): DEFINES += QTC_SHOW_BUILD_DATE
include(../../qtcreatorplugin.pri)
win32-msvc*:QMAKE_CXXFLAGS += -wd4251 -wd4290 -wd4250
SOURCES += corejsextensions.cpp \

View File

@@ -63,23 +63,28 @@ VersionDialog::VersionDialog(QWidget *parent)
//: This gets conditionally inserted as argument %8 into the description string.
ideRev = tr("From revision %1<br/>").arg(QString::fromLatin1(Constants::IDE_REVISION_STR).left(10));
#endif
QString buildDateInfo;
#ifdef QTC_SHOW_BUILD_DATE
buildDateInfo = tr("Built on %1 %2<br/>").arg(QLatin1String(__DATE__), QLatin1String(__TIME__));
#endif
const QString description = tr(
"<h3>%1</h3>"
"%2<br/>"
"<br/>"
"Built on %3 at %4<br />"
"%3"
"<br/>"
"%5"
"%4"
"<br/>"
"Copyright 2008-%6 %7. All rights reserved.<br/>"
"Copyright 2008-%5 %6. All rights reserved.<br/>"
"<br/>"
"The program is provided AS IS with NO WARRANTY OF ANY KIND, "
"INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A "
"PARTICULAR PURPOSE.<br/>")
.arg(ICore::versionString(),
ICore::buildCompatibilityString(),
QLatin1String(__DATE__), QLatin1String(__TIME__),
buildDateInfo,
ideRev,
QLatin1String(Constants::IDE_YEAR),
QLatin1String(Constants::IDE_AUTHOR));

View File

@@ -138,9 +138,9 @@ void CrashHandlerDialog::setApplicationInfo(const QString &signalName)
revision = QLatin1Char(' ') + tr("from revision %1").arg(QString::fromLatin1(Core::Constants::IDE_REVISION_STR).left(10));
#endif
const QString versionInformation = tr(
"%1 %2%3, built on %4 at %5, based on Qt %6 (%7 bit)\n")
"%1 %2%3, based on Qt %4 (%5 bit)\n")
.arg(ideName, QLatin1String(Core::Constants::IDE_VERSION_LONG), revision,
QLatin1String(__DATE__), QLatin1String(__TIME__), QLatin1String(QT_VERSION_STR),
QLatin1String(QT_VERSION_STR),
QString::number(QSysInfo::WordSize));
m_ui->debugInfoEdit->append(versionInformation);
}