summaryrefslogtreecommitdiffstats
path: root/src/qdoc
diff options
context:
space:
mode:
Diffstat (limited to 'src/qdoc')
-rw-r--r--src/qdoc/clangcodeparser.cpp6
-rw-r--r--src/qdoc/doc/examples/cpp.qdoc.sample2
-rw-r--r--src/qdoc/main.cpp3
-rw-r--r--src/qdoc/qdoccommandlineparser.cpp36
-rw-r--r--src/qdoc/qdoccommandlineparser.h4
-rw-r--r--src/qdoc/qdocglobals.cpp51
-rw-r--r--src/qdoc/qdocglobals.h9
7 files changed, 64 insertions, 47 deletions
diff --git a/src/qdoc/clangcodeparser.cpp b/src/qdoc/clangcodeparser.cpp
index bbe3f9ba7..475becf4d 100644
--- a/src/qdoc/clangcodeparser.cpp
+++ b/src/qdoc/clangcodeparser.cpp
@@ -1127,13 +1127,14 @@ static const char *defaultArgs_[] = {
"-DQ_QDOC",
"-DQ_CLANG_QDOC",
"-DQT_DISABLE_DEPRECATED_BEFORE=0",
- "-DQT_ANNOTATE_CLASS(type,...)=static_assert(sizeof(#__VA_ARGS__), #type);",
- "-DQT_ANNOTATE_CLASS2(type,a1,a2)=static_assert(sizeof(#a1, #a2), #type);",
+ "-DQT_ANNOTATE_CLASS(type,...)=static_assert(sizeof(#__VA_ARGS__),#type);",
+ "-DQT_ANNOTATE_CLASS2(type,a1,a2)=static_assert(sizeof(#a1,#a2),#type);",
"-DQT_ANNOTATE_FUNCTION(a)=__attribute__((annotate(#a)))",
"-DQT_ANNOTATE_ACCESS_SPECIFIER(a)=__attribute__((annotate(#a)))",
"-Wno-constant-logical-operand",
"-Wno-macro-redefined",
"-Wno-nullability-completeness",
+ "-ferror-limit=0",
"-I" CLANG_RESOURCE_DIR
};
@@ -1304,6 +1305,7 @@ void ClangCodeParser::buildPCH()
out << line << "\n";
}
}
+ tmpHeaderFile.close();
}
if (printParsingErrors_ == 0)
Location::logToStdErrAlways("clang not printing errors; include paths were guessed");
diff --git a/src/qdoc/doc/examples/cpp.qdoc.sample b/src/qdoc/doc/examples/cpp.qdoc.sample
index 892e9c30d..0524a6756 100644
--- a/src/qdoc/doc/examples/cpp.qdoc.sample
+++ b/src/qdoc/doc/examples/cpp.qdoc.sample
@@ -46,7 +46,7 @@
\snippet code/doc_src_qcache.cpp 1
- ... detailed description ommitted
+ ... detailed description omitted
\sa QPixmapCache, QHash, QMap
*/
diff --git a/src/qdoc/main.cpp b/src/qdoc/main.cpp
index 3ce7ef9ea..39ad0c9a2 100644
--- a/src/qdoc/main.cpp
+++ b/src/qdoc/main.cpp
@@ -581,7 +581,8 @@ int main(int argc, char **argv)
// Set the globals declared at the top of this file:
QDocCommandLineParser parser;
- parser.process(app.arguments(), qdocGlobals);
+ parser.process(app.arguments());
+ qdocGlobals.setOptions(parser);
config.setOptions(parser);
postProcess(parser);
diff --git a/src/qdoc/qdoccommandlineparser.cpp b/src/qdoc/qdoccommandlineparser.cpp
index be8513e4b..33009c512 100644
--- a/src/qdoc/qdoccommandlineparser.cpp
+++ b/src/qdoc/qdoccommandlineparser.cpp
@@ -28,7 +28,6 @@
#include "qdoccommandlineparser.h"
-#include "config.h"
#include "loggingcategory.h"
#include "utilities.h"
@@ -179,44 +178,11 @@ static QStringList argumentsFromCommandLineAndFile(const QStringList &arguments)
return allArguments;
}
-void QDocCommandLineParser::process(const QStringList &arguments, QDocGlobals &qdocGlobals)
+void QDocCommandLineParser::process(const QStringList &arguments)
{
auto allArguments = argumentsFromCommandLineAndFile(arguments);
QCommandLineParser::process(allArguments);
- qdocGlobals.addDefine(values(defineOption));
- qdocGlobals.dependModules() += values(dependsOption);
- qdocGlobals.enableHighlighting(isSet(highlightingOption));
- qdocGlobals.setShowInternal(isSet(showInternalOption));
- qdocGlobals.setSingleExec(isSet(singleExecOption));
- qdocGlobals.setWriteQaPages(isSet(writeQaPagesOption));
- qdocGlobals.setRedirectDocumentationToDevNull(isSet(redirectDocumentationToDevNullOption));
-
- const auto indexDirs = values(indexDirOption);
- for (const auto &indexDir : indexDirs) {
- if (QFile::exists(indexDir))
- qdocGlobals.appendToIndexDirs(indexDir);
- else
- qDebug() << "Cannot find index directory" << indexDir;
- }
- qdocGlobals.setObsoleteLinks(isSet(obsoleteLinksOption));
- qdocGlobals.setNoLinkErrors(isSet(noLinkErrorsOption) || qEnvironmentVariableIsSet("QDOC_NOLINKERRORS"));
- qdocGlobals.setAutolinkErrors(isSet(autoLinkErrorsOption));
-
if (isSet(singleExecOption) && isSet(indexDirOption))
qDebug("WARNING: -indexdir option ignored: Index files are not used in single-exec mode.");
-
- QDir currentDir = QDir::current();
- const auto paths = values(includePathOption);
- for (const auto &i : paths)
- qdocGlobals.addIncludePath("-I", currentDir.absoluteFilePath(i));
-
-#ifdef QDOC_PASS_ISYSTEM
- const auto paths2 = values(includePathSystemOption);
- for (const auto &i : paths2)
- qdocGlobals.addIncludePath("-isystem", currentDir.absoluteFilePath(i));
-#endif
- const auto paths3 = values(frameworkOption);
- for (const auto &i : paths3)
- qdocGlobals.addIncludePath("-F", currentDir.absoluteFilePath(i));
}
diff --git a/src/qdoc/qdoccommandlineparser.h b/src/qdoc/qdoccommandlineparser.h
index e669765a6..d88cb6ffc 100644
--- a/src/qdoc/qdoccommandlineparser.h
+++ b/src/qdoc/qdoccommandlineparser.h
@@ -29,8 +29,6 @@
#ifndef QDOCCOMMANDLINEPARSER_H
#define QDOCCOMMANDLINEPARSER_H
-#include "qdocglobals.h"
-
#include <QtCore/qcommandlineparser.h>
QT_BEGIN_NAMESPACE
@@ -38,7 +36,7 @@ QT_BEGIN_NAMESPACE
struct QDocCommandLineParser : public QCommandLineParser
{
QDocCommandLineParser();
- void process(const QStringList &arguments, QDocGlobals &qdocGlobals);
+ void process(const QStringList &arguments);
QCommandLineOption defineOption, dependsOption, highlightingOption;
QCommandLineOption showInternalOption, redirectDocumentationToDevNullOption;
diff --git a/src/qdoc/qdocglobals.cpp b/src/qdoc/qdocglobals.cpp
index a79d47405..22e9beb70 100644
--- a/src/qdoc/qdocglobals.cpp
+++ b/src/qdoc/qdocglobals.cpp
@@ -27,10 +27,11 @@
****************************************************************************/
#include "qdocglobals.h"
+#include "qdoccommandlineparser.h"
-QDocGlobals::QDocGlobals()
-{
-}
+#include <QtCore/qdebug.h>
+#include <QtCore/qdir.h>
+#include <QtCore/qfile.h>
bool QDocGlobals::highlighting()
{
@@ -166,3 +167,47 @@ void QDocGlobals::setPreviousCurrentDir(const QString &path)
m_previousCurrentDir = path;
}
+void QDocGlobals::setIncludePaths(const QDocCommandLineParser &parser)
+{
+ QDir currentDir = QDir::current();
+ auto includePaths = parser.values(parser.includePathOption);
+ for (const auto &path : qAsConst(includePaths))
+ addIncludePath("-I", currentDir.absoluteFilePath(path));
+
+#ifdef QDOC_PASS_ISYSTEM
+ includePaths = parser.values(parser.includePathSystemOption);
+ for (const auto &path : qAsConst(includePaths))
+ addIncludePath("-isystem", currentDir.absoluteFilePath(path));
+#endif
+ includePaths = parser.values(parser.frameworkOption);
+ for (const auto &path : qAsConst(includePaths))
+ addIncludePath("-F", currentDir.absoluteFilePath(path));
+}
+
+void QDocGlobals::setIndexDirs(const QDocCommandLineParser &parser)
+{
+ const auto indexDirs = parser.values(parser.indexDirOption);
+ for (const auto &indexDir : indexDirs) {
+ if (QFile::exists(indexDir))
+ appendToIndexDirs(indexDir);
+ else
+ qDebug() << "Cannot find index directory" << indexDir;
+ }
+}
+
+void QDocGlobals::setOptions(const QDocCommandLineParser &parser)
+{
+ addDefine(parser.values(parser.defineOption));
+ m_dependModules += parser.values(parser.dependsOption);
+ enableHighlighting(parser.isSet(parser.highlightingOption));
+ setShowInternal(parser.isSet(parser.showInternalOption));
+ setSingleExec(parser.isSet(parser.singleExecOption));
+ setWriteQaPages(parser.isSet(parser.writeQaPagesOption));
+ setRedirectDocumentationToDevNull(parser.isSet(parser.redirectDocumentationToDevNullOption));
+ setIndexDirs(parser);
+ setObsoleteLinks(parser.isSet(parser.obsoleteLinksOption));
+ setNoLinkErrors(parser.isSet(parser.noLinkErrorsOption) ||
+ qEnvironmentVariableIsSet("QDOC_NOLINKERRORS"));
+ setAutolinkErrors(parser.isSet(parser.autoLinkErrorsOption));
+ setIncludePaths(parser);
+}
diff --git a/src/qdoc/qdocglobals.h b/src/qdoc/qdocglobals.h
index c849df19b..d1198db37 100644
--- a/src/qdoc/qdocglobals.h
+++ b/src/qdoc/qdocglobals.h
@@ -34,11 +34,12 @@
#include <QtCore/qtranslator.h>
QT_BEGIN_NAMESPACE
+
+struct QDocCommandLineParser;
+
class QDocGlobals
{
public:
- QDocGlobals();
-
bool highlighting();
void enableHighlighting(bool value);
@@ -80,8 +81,12 @@ public:
QString previousCurrentDir();
void setPreviousCurrentDir(const QString &path);
+ void setOptions(const QDocCommandLineParser &parser);
private:
+ void setIncludePaths(const QDocCommandLineParser &parser);
+ void setIndexDirs(const QDocCommandLineParser &parser);
+
bool m_highlighting = false;
bool m_showInternal = false;
bool m_singleExec = false;