Avoid hardcoding build date in qtcore and tools

To ensure QtCore can be rebuilt and get the exact same results,
it is undesirable to hardcode the build date into the library

Also deprecate QLibrayInfo::buildDate since it is relies on the build
date. QLibraryInfo::buildDate was originally meant for evaluation
licenses and such, but isn't used for that any longer.

Change-Id: I98e91ca3e55f877e6ac0e02de289dc29422fc9da
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
This commit is contained in:
Sune Vuorela 2015-02-05 07:37:13 +01:00
parent c030540f37
commit db631a88a0
4 changed files with 9 additions and 6 deletions

2
configure vendored
View File

@ -3744,7 +3744,7 @@ static const char qt_configure_licensee_str [256 + 12] = "qt_lcnsuser=$
static const char qt_configure_licensed_products_str [256 + 12] = "qt_lcnsprod=$Edition"; static const char qt_configure_licensed_products_str [256 + 12] = "qt_lcnsprod=$Edition";
/* Installation date */ /* Installation date */
static const char qt_configure_installation [12+11] = "qt_instdate=`date +%Y-%m-%d`"; static const char qt_configure_installation [12+11] = "qt_instdate=2012-12-20";
/* Installation Info */ /* Installation Info */
static const char qt_configure_prefix_path_str [256 + 12] = "qt_prfxpath=$QT_INSTALL_PREFIX"; static const char qt_configure_prefix_path_str [256 + 12] = "qt_prfxpath=$QT_INSTALL_PREFIX";

View File

@ -229,15 +229,17 @@ QLibraryInfo::licensedProducts()
/*! /*!
\since 4.6 \since 4.6
Returns the installation date for this build of Qt. The install date will \deprecated
usually be the last time that Qt sources were configured. This function used to return the the installation date for this build of Qt, but now returns an a constant date.
*/ */
#ifndef QT_NO_DATESTRING #ifndef QT_NO_DATESTRING
#if QT_DEPRECATED_SINCE(5, 5)
QDate QDate
QLibraryInfo::buildDate() QLibraryInfo::buildDate()
{ {
return QDate::fromString(QString::fromLatin1(qt_configure_installation + 12), Qt::ISODate); return QDate::fromString(QString::fromLatin1(qt_configure_installation + 12), Qt::ISODate);
} }
#endif
#endif //QT_NO_DATESTRING #endif //QT_NO_DATESTRING
#if defined(Q_CC_INTEL) // must be before GNU, Clang and MSVC because ICC/ICL claim to be them #if defined(Q_CC_INTEL) // must be before GNU, Clang and MSVC because ICC/ICL claim to be them

View File

@ -48,7 +48,9 @@ public:
static QString licensedProducts(); static QString licensedProducts();
#ifndef QT_NO_DATESTRING #ifndef QT_NO_DATESTRING
static QDate buildDate(); #if QT_DEPRECATED_SINCE(5, 5)
static QT_DEPRECATED QDate buildDate();
#endif // QT_DEPRECATED_SINCE(5, 5)
#endif //QT_NO_DATESTRING #endif //QT_NO_DATESTRING
static const char * build() Q_DECL_NOTHROW; static const char * build() Q_DECL_NOTHROW;

View File

@ -38,7 +38,6 @@
# include "tools.h" # include "tools.h"
#endif #endif
#include <qdatetime.h>
#include <qdir.h> #include <qdir.h>
#include <qdiriterator.h> #include <qdiriterator.h>
#include <qtemporaryfile.h> #include <qtemporaryfile.h>
@ -4068,7 +4067,7 @@ void Configure::generateQConfigCpp()
<< "static const char qt_configure_licensed_products_str [512 + 12] = \"qt_lcnsprod=" << dictionary["EDITION"] << "\";" << endl << "static const char qt_configure_licensed_products_str [512 + 12] = \"qt_lcnsprod=" << dictionary["EDITION"] << "\";" << endl
<< endl << endl
<< "/* Build date */" << endl << "/* Build date */" << endl
<< "static const char qt_configure_installation [11 + 12] = \"qt_instdate=" << QDate::currentDate().toString(Qt::ISODate) << "\";" << endl << "static const char qt_configure_installation [11 + 12] = \"qt_instdate=2012-12-20\";" << endl
<< endl << endl
<< "/* Installation Info */" << endl << "/* Installation Info */" << endl
<< "static const char qt_configure_prefix_path_str [512 + 12] = \"qt_prfxpath=" << dictionary["QT_INSTALL_PREFIX"] << "\";" << endl << "static const char qt_configure_prefix_path_str [512 + 12] = \"qt_prfxpath=" << dictionary["QT_INSTALL_PREFIX"] << "\";" << endl