Clang: Add lastModified to the precompiled header

It is important to know then the PCH generation started, so we can compare
the header file time stamps against it.

Change-Id: Id8ee91e886c153d9d4a37cc0438c682f2098f7fa
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
This commit is contained in:
Marco Bubke
2018-02-15 14:29:20 +01:00
parent f67df4f9ab
commit 1f0562742e
13 changed files with 48 additions and 44 deletions

View File

@@ -33,6 +33,7 @@
#include <projectpartpch.h>
#include <QCryptographicHash>
#include <QDateTime>
#include <QFile>
#include <QTemporaryFile>
@@ -545,6 +546,7 @@ Utils::SmallStringVector PchCreator::generateProjectPartClangCompilerArguments(
IdPaths PchCreator::generateProjectPartPch(const V2::ProjectPartContainer &projectPart)
{
long long lastModified = QDateTime::currentSecsSinceEpoch();
auto includes = generateProjectPartPchIncludes(projectPart);
auto content = generatePchIncludeFileContent(includes);
auto pchIncludeFilePath = generateProjectPathPchHeaderFilePath(projectPart);
@@ -552,7 +554,7 @@ IdPaths PchCreator::generateProjectPartPch(const V2::ProjectPartContainer &proje
generateFileWithContent(pchIncludeFilePath, content);
generatePch(generateProjectPartClangCompilerArguments(projectPart),
{projectPart.projectPartId().clone(), std::move(pchFilePath)});
{projectPart.projectPartId().clone(), std::move(pchFilePath), lastModified});
return {projectPart.projectPartId().clone(), std::move(includes)};
}