summaryrefslogtreecommitdiffstats
path: root/Source/cmQtAutoMocUic.cxx
diff options
context:
space:
mode:
authorJason Haslam <jason@scitools.com>2022-12-05 02:56:00 (GMT)
committerJason Haslam <jason@scitools.com>2022-12-05 02:56:00 (GMT)
commit318ec0756045818c6697ac3a496e8e8b8e984484 (patch)
treecd38b279c0c83563cfc907750f043bcc1ff1fc45 /Source/cmQtAutoMocUic.cxx
parent2e3ae48819b80c7d141d426299ba47f3aa3d7b1c (diff)
downloadCMake-318ec0756045818c6697ac3a496e8e8b8e984484.zip
CMake-318ec0756045818c6697ac3a496e8e8b8e984484.tar.gz
CMake-318ec0756045818c6697ac3a496e8e8b8e984484.tar.bz2
automoc: Remove existing output file before invoking moc
Remove the output file before invoking moc in case the case of source file has changed on disk. Recent versions of clang warn when the case of the include directive (which does change) doesn't match the case of the file on disk.
Diffstat (limited to 'Source/cmQtAutoMocUic.cxx')
-rw-r--r--Source/cmQtAutoMocUic.cxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/Source/cmQtAutoMocUic.cxx b/Source/cmQtAutoMocUic.cxx
index 4753e61..683c18f 100644
--- a/Source/cmQtAutoMocUic.cxx
+++ b/Source/cmQtAutoMocUic.cxx
@@ -1981,6 +1981,9 @@ void cmQtAutoMocUicT::JobCompileMocT::Process()
std::string const& sourceFile = this->Mapping->SourceFile->FileName;
std::string const& outputFile = this->Mapping->OutputFile;
+ // Remove output file in case the case of the source file has changed
+ cmSystemTools::RemoveFile(outputFile);
+
// Compose moc command
std::vector<std::string> cmd;
{