forked from qt-creator/qt-creator
CppTools: Parse non-project sources with default kit
This makes more sense than using the clang defaults. Task-number: QTCREATORBUG-25562 Change-Id: I796d29bb4e81e5e257efea998dcab037efd8a717 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -31,6 +31,8 @@
|
||||
#include <QDir>
|
||||
#include <QTextStream>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
|
||||
namespace CppTools {
|
||||
|
||||
void ProjectPart::updateLanguageFeatures()
|
||||
@@ -53,6 +55,41 @@ void ProjectPart::updateLanguageFeatures()
|
||||
}
|
||||
}
|
||||
|
||||
void ProjectPart::setupToolchainProperties(const ToolChainInfo &tcInfo, const QStringList &flags)
|
||||
{
|
||||
toolchainType = tcInfo.type;
|
||||
isMsvc2015Toolchain = tcInfo.isMsvc2015ToolChain;
|
||||
toolChainWordWidth = tcInfo.wordWidth == 64 ? ProjectPart::WordWidth64Bit
|
||||
: ProjectPart::WordWidth32Bit;
|
||||
toolChainInstallDir = tcInfo.installDir;
|
||||
toolChainTargetTriple = tcInfo.targetTriple;
|
||||
extraCodeModelFlags = tcInfo.extraCodeModelFlags;
|
||||
compilerFlags = flags;
|
||||
|
||||
// Toolchain macros and language version
|
||||
if (tcInfo.macroInspectionRunner) {
|
||||
const auto macroInspectionReport = tcInfo.macroInspectionRunner(compilerFlags);
|
||||
toolChainMacros = macroInspectionReport.macros;
|
||||
languageVersion = macroInspectionReport.languageVersion;
|
||||
// No compiler set in kit.
|
||||
} else if (language == Utils::Language::C) {
|
||||
languageVersion = Utils::LanguageVersion::LatestC;
|
||||
} else {
|
||||
languageVersion = Utils::LanguageVersion::LatestCxx;
|
||||
}
|
||||
|
||||
// Header paths
|
||||
if (tcInfo.headerPathsRunner) {
|
||||
const HeaderPaths builtInHeaderPaths
|
||||
= tcInfo.headerPathsRunner(compilerFlags, tcInfo.sysRootPath, tcInfo.targetTriple);
|
||||
for (const HeaderPath &header : builtInHeaderPaths) {
|
||||
const HeaderPath headerPath{header.path, header.type};
|
||||
if (!headerPaths.contains(headerPath))
|
||||
headerPaths.push_back(headerPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ProjectPart::Ptr ProjectPart::copy() const
|
||||
{
|
||||
return Ptr(new ProjectPart(*this));
|
||||
|
||||
Reference in New Issue
Block a user