From c003a913e3dd71835577a8bba327007e8f3d06f8 Mon Sep 17 00:00:00 2001 From: Martin Smith <martin.smith@qt.io> Date: Fri, 9 Mar 2018 10:39:54 +0100 Subject: [PATCH] qdoc: Remove -fPIC from default options when Q_OS_WIN MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This update only adds -fPIC to the options passed to clang if Q_OS_WIN is not defined. Change-Id: I473ac14a026aecff141ab6d16e6283efe7bc5bd5 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Topi Reiniö <topi.reinio@qt.io> --- src/qdoc/clangcodeparser.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/qdoc/clangcodeparser.cpp b/src/qdoc/clangcodeparser.cpp index 5342bb34b..70d73a18e 100644 --- a/src/qdoc/clangcodeparser.cpp +++ b/src/qdoc/clangcodeparser.cpp @@ -1079,7 +1079,9 @@ void ClangCodeParser::parseHeaderFile(const Location & /*location*/, const QStri static const char *defaultArgs_[] = { "-std=c++14", +#ifndef Q_OS_WIN "-fPIC", +#endif "-fno-exceptions", // Workaround for clang bug http://reviews.llvm.org/D17988 "-DQ_QDOC", "-DQT_DISABLE_DEPRECATED_BEFORE=0", @@ -1442,7 +1444,7 @@ Node* ClangCodeParser::parseFnArg(const Location& location, const QString& fnArg CXTranslationUnit_SkipFunctionBodies | CXTranslationUnit_KeepGoing); // Change 2nd parameter to 1 to make clang report errors. - CXIndex index = clang_createIndex(1, 0); + CXIndex index = clang_createIndex(1, Generator::debugging() ? 1 : 0); std::vector<const char *> args(std::begin(defaultArgs_), std::end(defaultArgs_)); // Add the defines from the qdocconf file. -- GitLab