Autotools: added parsing defines and C/C++ flags from Makefile

Change-Id: I7443ba3ada97e4abac5560bb5399ec96e065acee
Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
Sergey Shambir
2013-04-29 02:31:43 +04:00
committed by hjk
parent d07d683691
commit 7688754b37
5 changed files with 188 additions and 13 deletions

View File

@@ -411,7 +411,10 @@ void AutotoolsProject::updateCppCodeModel()
if (!modelManager)
return;
const QStringList cxxflags; // FIXME: Autotools should be able to do better than this!
const QStringList cflags = m_makefileParserThread->cflags();
QStringList cxxflags = m_makefileParserThread->cxxflags();
if (cxxflags.isEmpty())
cxxflags = cflags;
CppTools::CppModelManagerInterface::ProjectInfo pinfo = modelManager->projectInfo(this);
pinfo.clearProjectParts();
@@ -420,7 +423,7 @@ void AutotoolsProject::updateCppCodeModel()
if (activeTarget()) {
ProjectExplorer::Kit *k = activeTarget()->kit();
ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(k);
part->evaluateToolchain(tc, cxxflags, cxxflags,
part->evaluateToolchain(tc, cxxflags, cflags,
SysRootKitInformation::sysRoot(k));
}
@@ -428,6 +431,7 @@ void AutotoolsProject::updateCppCodeModel()
part->files << CppTools::ProjectFile(file, CppTools::ProjectFile::CXXSource);
part->includePaths += m_makefileParserThread->includePaths();
part->defines += m_makefileParserThread->defines();
pinfo.appendProjectPart(part);
modelManager->updateProjectInfo(pinfo);