summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@qt.io>2020-09-28 21:24:04 +0200
committerJoerg Bornemann <joerg.bornemann@qt.io>2020-10-01 11:33:31 +0200
commit66f94e884787a0ac394909351f8f810357186b31 (patch)
treebf53559989ab24c450cc32a92040dbcd38af9b6d
parent50540b3997fdd7ccf4d83cd446bbb3b1e69bbdc8 (diff)
lupdate: Yield error if -clang-parser requested in non-clang build
If lupdate is built without clang support, -clang-parser must be an error. Change-Id: I88c7d47452c48e01d6a1609e25094c514e88f953 Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
-rw-r--r--src/linguist/lupdate/main.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/linguist/lupdate/main.cpp b/src/linguist/lupdate/main.cpp
index faf5f5f0e..9dcba2b3c 100644
--- a/src/linguist/lupdate/main.cpp
+++ b/src/linguist/lupdate/main.cpp
@@ -495,7 +495,7 @@ static bool processTs(Translator &fetchedTor, const QString &file, ConversionDat
}
static void processSources(Translator &fetchedTor,
- const QStringList &sourceFiles, ConversionData &cd)
+ const QStringList &sourceFiles, ConversionData &cd, bool *fail)
{
#ifdef QT_NO_QML
bool requireQmlSupport = false;
@@ -531,6 +531,9 @@ static void processSources(Translator &fetchedTor,
if (useClangToParseCpp) {
#if QT_CONFIG(clangcpp)
ClangCppParser::loadCPP(fetchedTor, sourceFilesCpp, cd);
+#else
+ *fail = true;
+ printErr(LU::tr("lupdate error: lupdate was built without clang support."));
#endif
}
else
@@ -628,7 +631,7 @@ private:
}
Translator tor;
processProjects(false, options, prj.subProjects, false, &tor, fail);
- processSources(tor, sources, cd);
+ processSources(tor, sources, cd, fail);
updateTsFiles(tor, tsFiles, QStringList(), m_sourceLanguage, m_targetLanguage,
options, fail);
return;
@@ -642,10 +645,10 @@ private:
}
Translator tor;
processProjects(false, options, prj.subProjects, nestComplain, &tor, fail);
- processSources(tor, sources, cd);
+ processSources(tor, sources, cd, fail);
} else {
processProjects(false, options, prj.subProjects, nestComplain, parentTor, fail);
- processSources(*parentTor, sources, cd);
+ processSources(*parentTor, sources, cd, fail);
}
}
@@ -1036,7 +1039,7 @@ int main(int argc, char **argv)
cd.m_compileCommandsPath = commandLineCompileCommands;
for (const QString &resource : qAsConst(resourceFiles))
sourceFiles << getResources(resource);
- processSources(fetchedTor, sourceFiles, cd);
+ processSources(fetchedTor, sourceFiles, cd, &fail);
updateTsFiles(fetchedTor, tsFileNames, alienFiles,
sourceLanguage, targetLanguage, options, &fail);
} else {