From 2b3798ecd21ad938f6a22a9a1adc51a988a6a87a Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Mon, 13 Mar 2017 11:02:59 +0100 Subject: qdoc: Add moduleheader as config variable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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ƶ --- src/qdoc/clangcodeparser.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/qdoc/clangcodeparser.cpp') 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. -- cgit v1.2.1