aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/generator/generator.cpp
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2018-10-19 16:16:37 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2018-10-23 07:45:46 +0000
commit1719517834d953abb4e37be4c824854dee9795ac (patch)
tree32d40fac36cdbfb8cc7ee7aca6d8578d5d31ab03 /sources/shiboken2/generator/generator.cpp
parentd1d08a134d2b22b91150a70a1ec23f576bb38398 (diff)
Stop updating timestamps of generated files that haven't changed
This is a change in preparation for improved incremental builds, where modifying one typesystem XML file will not force rebuilding all generated cpp files. The previous logic was incorrect, file timestamps should not be updated if the generated files are unchanged, instead the build rules need to be adapted to prevent unnecessary rebuilds. Change-Id: Ia47f8ff1970e974d0e617b6891ab58666da3b1ff Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/shiboken2/generator/generator.cpp')
-rw-r--r--sources/shiboken2/generator/generator.cpp15
1 files changed, 1 insertions, 14 deletions
diff --git a/sources/shiboken2/generator/generator.cpp b/sources/shiboken2/generator/generator.cpp
index 85a8c4769..8b37b44e0 100644
--- a/sources/shiboken2/generator/generator.cpp
+++ b/sources/shiboken2/generator/generator.cpp
@@ -395,20 +395,7 @@ bool Generator::generateFileForContext(GeneratorContext &context)
generateClass(fileOut.stream, context);
- FileOut::State state = fileOut.done();
- switch (state) {
- case FileOut::Failure:
- return false;
- case FileOut::Unchanged:
- // Even if contents is unchanged, the last file modification time should be updated,
- // so that the build system can rely on the fact the generated file is up-to-date.
- fileOut.touch();
- break;
- case FileOut::Success:
- break;
- }
-
- return true;
+ return fileOut.done() != FileOut::Failure;
}
QString Generator::getFileNameBaseForSmartPointer(const AbstractMetaType *smartPointerType,