diff options
author | Eike Ziller <eike.ziller@qt.io> | 2020-03-11 07:29:47 +0100 |
---|---|---|
committer | Eike Ziller <eike.ziller@qt.io> | 2020-03-11 07:29:47 +0100 |
commit | 95d41fa23e21ba02d54549fbc948e970b5aed430 (patch) | |
tree | 7b64f9c5a9d1a694e4a00594d99227b143fd2d8d /src/plugins/cpptools | |
parent | b0779ad5f81bae5513df1a1eae6f9e5e2b6aa679 (diff) | |
parent | c0704f51b22c9d447ad8c25a0c1a9d772892d265 (diff) |
Merge remote-tracking branch 'origin/4.12'
Conflicts:
src/plugins/qmldesigner/designmodewidget.cpp
Change-Id: I94a94a15df433d6caa8922fccaa69918b5e4e365
Diffstat (limited to 'src/plugins/cpptools')
-rw-r--r-- | src/plugins/cpptools/compileroptionsbuilder.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/plugins/cpptools/compileroptionsbuilder.cpp b/src/plugins/cpptools/compileroptionsbuilder.cpp index fcce3d6cc5..e559a8400c 100644 --- a/src/plugins/cpptools/compileroptionsbuilder.cpp +++ b/src/plugins/cpptools/compileroptionsbuilder.cpp @@ -341,19 +341,17 @@ void CompilerOptionsBuilder::addHeaderPathOptions() void CompilerOptionsBuilder::addPrecompiledHeaderOptions(UsePrecompiledHeaders usePrecompiledHeaders) { for (const QString &pchFile : m_projectPart.precompiledHeaders) { - // Bail if build system precomiple header artifacts exists + // Bail if build system precompiled header artifacts exists. // Clang cannot handle foreign PCH files. - if (QFile::exists(pchFile + ".gch") || QFile::exists(pchFile + ".pch")) { + if (QFile::exists(pchFile + ".gch") || QFile::exists(pchFile + ".pch")) usePrecompiledHeaders = UsePrecompiledHeaders::No; - // In case of Clang compilers, remove the pch-inclusion arguments - remove({"-Xclang", "-include-pch", "-Xclang", pchFile + ".gch"}); - remove({"-Xclang", "-include-pch", "-Xclang", pchFile + ".pch"}); - } - if (usePrecompiledHeaders == UsePrecompiledHeaders::No) { // CMake PCH will already have force included the header file in // command line options, remove it if exists. + // In case of Clang compilers, also remove the pch-inclusion arguments. + remove({"-Xclang", "-include-pch", "-Xclang", pchFile + ".gch"}); + remove({"-Xclang", "-include-pch", "-Xclang", pchFile + ".pch"}); remove({isClStyle() ? QLatin1String(includeFileOptionCl) : QLatin1String(includeFileOptionGcc), pchFile}); } else if (QFile::exists(pchFile)) { |