summaryrefslogtreecommitdiff
path: root/src/qdoc/clangcodeparser.cpp
diff options
context:
space:
mode:
authorMartin Smith <martin.smith@qt.io>2017-03-13 11:02:59 +0100
committerMartin Smith <martin.smith@qt.io>2017-08-10 07:34:53 +0000
commit2b3798ecd21ad938f6a22a9a1adc51a988a6a87a (patch)
tree0c82b9b4bd68302701286ddcc87ce0cc02c5e0e9 /src/qdoc/clangcodeparser.cpp
parent67f406656ffc8a2afd720dabe0e54545c265c573 (diff)
downloadqttools-2b3798ecd21ad938f6a22a9a1adc51a988a6a87a.tar.gz
qdoc: Add moduleheader as config variable
moduleheader is a new config variable you can add to the qdocconf file when the name of the module header file for your module is different from the project name. When the name of the module header file is different from the project name, if you don't tell qdoc what the name of the module header file is by setting moduleheader in the qdocconf file, then clangqdoc will not find the module header file to build the precomiled header with, which will result in clang not finding a lot of stuff. Change-Id: I0da1a0b0be05cb9e6e95e0123583ddeedaf6741d Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io>
Diffstat (limited to 'src/qdoc/clangcodeparser.cpp')
-rw-r--r--src/qdoc/clangcodeparser.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/qdoc/clangcodeparser.cpp b/src/qdoc/clangcodeparser.cpp
index 94ec289cb..142b495be 100644
--- a/src/qdoc/clangcodeparser.cpp
+++ b/src/qdoc/clangcodeparser.cpp
@@ -958,7 +958,8 @@ void ClangCodeParser::buildPCH()
if (!pchFileDir_) {
pchFileDir_.reset(new QTemporaryDir(QDir::tempPath() + QLatin1String("/qdoc_pch")));
if (pchFileDir_->isValid()) {
- const QByteArray module = qdb_->primaryTreeRoot()->tree()->camelCaseModuleName().toUtf8();
+ //const QByteArray module = qdb_->primaryTreeRoot()->tree()->camelCaseModuleName().toUtf8();
+ const QByteArray module = moduleHeader().toUtf8();
QByteArray header;
QByteArray privateHeaderDir;
// Find the path to the module's header (e.g. QtGui/QtGui) to be used
@@ -972,6 +973,15 @@ void ClangCodeParser::buildPCH()
}
}
}
+ if (header.isEmpty()) {
+ for (const auto &p : qAsConst(includePaths_)) {
+ QByteArray candidate = p + "/" + module;
+ if (QFile::exists(QString::fromUtf8(candidate))) {
+ header = candidate;
+ break;
+ }
+ }
+ }
// Find the path to the module's private header directory (e.g.
// include/QtGui/5.8.0/QtGui/private) to use for including all
// the private headers in the PCH.