Commit 82430a6b authored by Thorbjørn Lindeijer's avatar Thorbjørn Lindeijer

Generic project: Made C++ code model work better without a tool chain

When no valid tool chain is selected, no project info update was done at
all. After this patch, at least the project defines and include paths
are used.

Reviewed-by: Roberto Raggi
parent 3518dd00
......@@ -207,28 +207,23 @@ void GenericProject::refresh(RefreshOptions options)
CPlusPlus::CppModelManagerInterface *modelManager =
CPlusPlus::CppModelManagerInterface::instance();
if (m_toolChain && modelManager) {
const QByteArray predefinedMacros = m_toolChain->predefinedMacros();
if (modelManager) {
CPlusPlus::CppModelManagerInterface::ProjectInfo pinfo = modelManager->projectInfo(this);
pinfo.defines = predefinedMacros;
pinfo.defines += '\n';
pinfo.defines += m_defines;
QStringList allIncludePaths;
QStringList allFrameworkPaths;
if (m_toolChain) {
pinfo.defines = m_toolChain->predefinedMacros();
pinfo.defines += '\n';
foreach (const HeaderPath &headerPath, m_toolChain->systemHeaderPaths()) {
if (headerPath.kind() == HeaderPath::FrameworkHeaderPath)
allFrameworkPaths.append(headerPath.path());
else
allIncludePaths.append(headerPath.path());
foreach (const HeaderPath &headerPath, m_toolChain->systemHeaderPaths()) {
if (headerPath.kind() == HeaderPath::FrameworkHeaderPath)
pinfo.frameworkPaths.append(headerPath.path());
else
pinfo.includePaths.append(headerPath.path());
}
}
allIncludePaths += this->allIncludePaths();
pinfo.frameworkPaths = allFrameworkPaths;
pinfo.includePaths = allIncludePaths;
pinfo.includePaths += allIncludePaths();
pinfo.defines += m_defines;
// ### add _defines.
pinfo.sourceFiles = files();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment