Commit eefd64dd authored by Roberto Raggi's avatar Roberto Raggi
Browse files

Fixed: C++ parser configuration (2nd try).

We use `cc' instead of `c++' and we also also moved the code in qt4project.cpp.
Done by ossi reviewed by me.
parent 1055eb5e
...@@ -691,17 +691,10 @@ void Qt4ProFileNode::update() ...@@ -691,17 +691,10 @@ void Qt4ProFileNode::update()
Qt4PriFileNode::update(fileForCurrentProject, reader); Qt4PriFileNode::update(fileForCurrentProject, reader);
QString qmakeCxx = reader->value(QLatin1String("QMAKE_CXX"));
if (qmakeCxx.isEmpty()) {
// macx-xcode mkspec resets the value of QMAKE_CXX.
// Unfortunately, we need a valid QMAKE_CXX to configure the parser.
qmakeCxx = QLatin1String("c++");
}
// update other variables // update other variables
QHash<Qt4Variable, QStringList> newVarValues; QHash<Qt4Variable, QStringList> newVarValues;
newVarValues[CxxCompilerVar] << qmakeCxx; newVarValues[CxxCompilerVar] << reader->value(QLatin1String("QMAKE_CXX"));
newVarValues[DefinesVar] = reader->values(QLatin1String("DEFINES")); newVarValues[DefinesVar] = reader->values(QLatin1String("DEFINES"));
newVarValues[IncludePathVar] = includePaths(reader); newVarValues[IncludePathVar] = includePaths(reader);
newVarValues[UiDirVar] = uiDirPaths(reader); newVarValues[UiDirVar] = uiDirPaths(reader);
......
...@@ -420,6 +420,13 @@ void Qt4Project::updateCodeModel() ...@@ -420,6 +420,13 @@ void Qt4Project::updateCodeModel()
if (t == QtVersion::MinGW || t == QtVersion::OTHER) { if (t == QtVersion::MinGW || t == QtVersion::OTHER) {
QStringList list = rootProjectNode()->variableValue(Internal::CxxCompilerVar); QStringList list = rootProjectNode()->variableValue(Internal::CxxCompilerVar);
QString qmake_cxx = list.isEmpty() ? QString::null : list.first(); QString qmake_cxx = list.isEmpty() ? QString::null : list.first();
if (qmake_cxx.isEmpty()) {
// macx-xcode mkspec resets the value of QMAKE_CXX.
// Unfortunately, we need a valid QMAKE_CXX to configure the parser.
qmake_cxx = QLatin1String("cc");
}
qmake_cxx = environment(activeBuildConfiguration()).searchInPath(qmake_cxx); qmake_cxx = environment(activeBuildConfiguration()).searchInPath(qmake_cxx);
m_preproc.setGcc(qmake_cxx); m_preproc.setGcc(qmake_cxx);
predefinedMacros = m_preproc.predefinedMacros(); predefinedMacros = m_preproc.predefinedMacros();
......
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