diff options
16 files changed, 86 insertions, 4 deletions
diff --git a/src/plugins/projectexplorer/gcctoolchain.cpp b/src/plugins/projectexplorer/gcctoolchain.cpp index 7659b81535..bf49fc16a0 100644 --- a/src/plugins/projectexplorer/gcctoolchain.cpp +++ b/src/plugins/projectexplorer/gcctoolchain.cpp @@ -376,6 +376,16 @@ QString GccToolChain::debuggerCommand() const return m_debuggerCommand; } +QString GccToolChain::mkspec() const +{ + Abi abi = targetAbi(); + if (abi.os() == Abi::MacOS) + return QLatin1String("macx-g++"); + if (abi.os() == Abi::LinuxOS) + return QLatin1String("linux-g++-") + QString::number(m_targetAbi.wordWidth()); + return QString(); +} + QString GccToolChain::makeCommand() const { return QLatin1String("make"); @@ -692,6 +702,11 @@ QString MingwToolChain::typeName() const return Internal::MingwToolChainFactory::tr("MinGW"); } +QString MingwToolChain::mkspec() const +{ + return QLatin1String("win32-g++"); +} + QString MingwToolChain::makeCommand() const { return QLatin1String("mingw32-make.exe"); @@ -781,6 +796,11 @@ IOutputParser *LinuxIccToolChain::outputParser() const return new LinuxIccParser; } +QString LinuxIccToolChain::mkspec() const +{ + return QLatin1String("linux-icc-") + QString::number(targetAbi().wordWidth()); +} + ToolChain *LinuxIccToolChain::clone() const { return new LinuxIccToolChain(*this); diff --git a/src/plugins/projectexplorer/gcctoolchain.h b/src/plugins/projectexplorer/gcctoolchain.h index 9871d85f38..6bcb5dc2a3 100644 --- a/src/plugins/projectexplorer/gcctoolchain.h +++ b/src/plugins/projectexplorer/gcctoolchain.h @@ -63,6 +63,7 @@ public: QByteArray predefinedMacros() const; QList<HeaderPath> systemHeaderPaths() const; void addToEnvironment(Utils::Environment &env) const; + QString mkspec() const; QString makeCommand() const; void setDebuggerCommand(const QString &); QString debuggerCommand() const; @@ -114,6 +115,7 @@ class PROJECTEXPLORER_EXPORT MingwToolChain : public GccToolChain { public: QString typeName() const; + QString mkspec() const; QString makeCommand() const; ToolChain *clone() const; @@ -137,6 +139,8 @@ public: IOutputParser *outputParser() const; + QString mkspec() const; + ToolChain *clone() const; private: diff --git a/src/plugins/projectexplorer/msvctoolchain.cpp b/src/plugins/projectexplorer/msvctoolchain.cpp index ac39312758..a1a8683cef 100644 --- a/src/plugins/projectexplorer/msvctoolchain.cpp +++ b/src/plugins/projectexplorer/msvctoolchain.cpp @@ -406,6 +406,17 @@ void MsvcToolChain::addToEnvironment(Utils::Environment &env) const env = m_resultEnvironment; } +QString MsvcToolChain::mkspec() const +{ + if (m_abi.osFlavor() == Abi::WindowsMsvc2005Flavor) + return QLatin1String("win32-msvc2005"); + if (m_abi.osFlavor() == Abi::WindowsMsvc2008Flavor) + return QLatin1String("win32-msvc2008"); + if (m_abi.osFlavor() == Abi::WindowsMsvc2010Flavor) + return QLatin1String("win32-msvc2010"); + return QString(); +} + QString MsvcToolChain::makeCommand() const { if (ProjectExplorerPlugin::instance()->projectExplorerSettings().useJom) { diff --git a/src/plugins/projectexplorer/msvctoolchain.h b/src/plugins/projectexplorer/msvctoolchain.h index 40906c057a..bde2695499 100644 --- a/src/plugins/projectexplorer/msvctoolchain.h +++ b/src/plugins/projectexplorer/msvctoolchain.h @@ -65,6 +65,7 @@ public: QByteArray predefinedMacros() const; QList<HeaderPath> systemHeaderPaths() const; void addToEnvironment(Utils::Environment &env) const; + QString mkspec() const; QString makeCommand() const; void setDebuggerCommand(const QString &d); virtual QString debuggerCommand() const; diff --git a/src/plugins/projectexplorer/toolchain.h b/src/plugins/projectexplorer/toolchain.h index 218a84d228..669f921887 100644 --- a/src/plugins/projectexplorer/toolchain.h +++ b/src/plugins/projectexplorer/toolchain.h @@ -83,6 +83,8 @@ public: virtual void addToEnvironment(Utils::Environment &env) const = 0; virtual QString makeCommand() const = 0; + virtual QString mkspec() const = 0; + virtual QString debuggerCommand() const = 0; virtual QString defaultMakeTarget() const; virtual IOutputParser *outputParser() const = 0; diff --git a/src/plugins/qt4projectmanager/baseqtversion.cpp b/src/plugins/qt4projectmanager/baseqtversion.cpp index bb6ecec873..af0203550d 100644 --- a/src/plugins/qt4projectmanager/baseqtversion.cpp +++ b/src/plugins/qt4projectmanager/baseqtversion.cpp @@ -597,6 +597,17 @@ QString BaseQtVersion::mkspecPath() const return m_mkspecFullPath; } +bool BaseQtVersion::hasMkspec(const QString &spec) const +{ + updateVersionInfo(); + QFileInfo fi; + fi.setFile(QDir::fromNativeSeparators(m_versionInfo.value("QMAKE_MKSPECS")) + '/' + spec); + if (fi.isDir()) + return true; + fi.setFile(sourcePath() + QLatin1String("/mkspecs/") + spec); + return fi.isDir(); +} + BaseQtVersion::QmakeBuildConfigs BaseQtVersion::defaultBuildConfig() const { ensureMkSpecParsed(); diff --git a/src/plugins/qt4projectmanager/baseqtversion.h b/src/plugins/qt4projectmanager/baseqtversion.h index 6cceb7e127..9314b81cfb 100644 --- a/src/plugins/qt4projectmanager/baseqtversion.h +++ b/src/plugins/qt4projectmanager/baseqtversion.h @@ -147,6 +147,8 @@ public: /// specifally not the directory the symlink/ORIGINAL_QMAKESPEC points to QString mkspecPath() const; + bool hasMkspec(const QString &) const; + enum QmakeBuildConfig { NoBuild = 1, diff --git a/src/plugins/qt4projectmanager/qmakestep.cpp b/src/plugins/qt4projectmanager/qmakestep.cpp index 45669a776f..01fbf3b0e6 100644 --- a/src/plugins/qt4projectmanager/qmakestep.cpp +++ b/src/plugins/qt4projectmanager/qmakestep.cpp @@ -130,12 +130,18 @@ QString QMakeStep::allArguments(bool shorted) arguments << QDir::toNativeSeparators(buildConfiguration()->target()->project()->file()->fileName()); arguments << "-r"; + bool haveSpec = false; for (Utils::QtcProcess::ArgIterator ait(&additonalArguments); ait.next(); ) if (ait.value() == QLatin1String("-spec")) - goto haveSpec; - if (bc->qtVersion()) - arguments << "-spec" << bc->qtVersion()->mkspec(); - haveSpec: + haveSpec = true; + + if (!haveSpec) { + const QString tcSpec = bc->toolChain() ? bc->toolChain()->mkspec() : QString(); + if (!tcSpec.isEmpty() && bc->qtVersion()->hasMkspec(tcSpec)) + arguments << "-spec" << tcSpec; + else + arguments << "-spec" << bc->qtVersion()->mkspec(); + } // Find out what flags we pass on to qmake arguments << bc->configCommandLineArguments(); diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemotoolchain.cpp b/src/plugins/qt4projectmanager/qt-maemo/maemotoolchain.cpp index 31cedc9ecd..844faeba32 100644 --- a/src/plugins/qt4projectmanager/qt-maemo/maemotoolchain.cpp +++ b/src/plugins/qt4projectmanager/qt-maemo/maemotoolchain.cpp @@ -82,6 +82,11 @@ ProjectExplorer::Abi MaemoToolChain::targetAbi() const return m_targetAbi; } +QString MaemoToolChain::mkspec() const +{ + return QString(); // always use default +} + bool MaemoToolChain::isValid() const { return GccToolChain::isValid() && m_qtVersionId >= 0 && m_targetAbi.isValid(); diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemotoolchain.h b/src/plugins/qt4projectmanager/qt-maemo/maemotoolchain.h index 6f4a796706..23c66cb69b 100644 --- a/src/plugins/qt4projectmanager/qt-maemo/maemotoolchain.h +++ b/src/plugins/qt4projectmanager/qt-maemo/maemotoolchain.h @@ -51,6 +51,7 @@ public: QString typeName() const; ProjectExplorer::Abi targetAbi() const; + QString mkspec() const; bool isValid() const; bool canClone() const; diff --git a/src/plugins/qt4projectmanager/qt-s60/gccetoolchain.cpp b/src/plugins/qt4projectmanager/qt-s60/gccetoolchain.cpp index 1b44236b63..12b85e1693 100644 --- a/src/plugins/qt4projectmanager/qt-s60/gccetoolchain.cpp +++ b/src/plugins/qt4projectmanager/qt-s60/gccetoolchain.cpp @@ -128,6 +128,11 @@ QString GcceToolChain::makeCommand() const #endif } +QString GcceToolChain::mkspec() const +{ + return QString(); // always use default from Qt version +} + QString GcceToolChain::defaultMakeTarget() const { return QLatin1String("gcce"); diff --git a/src/plugins/qt4projectmanager/qt-s60/gccetoolchain.h b/src/plugins/qt4projectmanager/qt-s60/gccetoolchain.h index ddc7d1f757..f290ccbe06 100644 --- a/src/plugins/qt4projectmanager/qt-s60/gccetoolchain.h +++ b/src/plugins/qt4projectmanager/qt-s60/gccetoolchain.h @@ -50,6 +50,7 @@ public: QByteArray predefinedMacros() const; void addToEnvironment(Utils::Environment &env) const; QString makeCommand() const; + QString mkspec() const; QString defaultMakeTarget() const; void setCompilerPath(const QString &); diff --git a/src/plugins/qt4projectmanager/qt-s60/rvcttoolchain.cpp b/src/plugins/qt4projectmanager/qt-s60/rvcttoolchain.cpp index 49dbdbeb06..52083b859c 100644 --- a/src/plugins/qt4projectmanager/qt-s60/rvcttoolchain.cpp +++ b/src/plugins/qt4projectmanager/qt-s60/rvcttoolchain.cpp @@ -225,6 +225,11 @@ void RvctToolChain::addToEnvironment(Utils::Environment &env) const env.set(QLatin1String("LANG"), QString(QLatin1Char('C'))); } +QString RvctToolChain::mkspec() const +{ + return QString(); // Always use default from Qt version +} + QString RvctToolChain::makeCommand() const { #if defined(Q_OS_WIN) diff --git a/src/plugins/qt4projectmanager/qt-s60/rvcttoolchain.h b/src/plugins/qt4projectmanager/qt-s60/rvcttoolchain.h index 9d1e820133..6580afe5d4 100644 --- a/src/plugins/qt4projectmanager/qt-s60/rvcttoolchain.h +++ b/src/plugins/qt4projectmanager/qt-s60/rvcttoolchain.h @@ -89,6 +89,7 @@ public: QByteArray predefinedMacros() const; QList<ProjectExplorer::HeaderPath> systemHeaderPaths() const; void addToEnvironment(Utils::Environment &env) const; + QString mkspec() const; QString makeCommand() const; QString defaultMakeTarget() const; ProjectExplorer::IOutputParser *outputParser() const; diff --git a/src/plugins/qt4projectmanager/qt-s60/winscwtoolchain.cpp b/src/plugins/qt4projectmanager/qt-s60/winscwtoolchain.cpp index 854033e237..99183d16b4 100644 --- a/src/plugins/qt4projectmanager/qt-s60/winscwtoolchain.cpp +++ b/src/plugins/qt4projectmanager/qt-s60/winscwtoolchain.cpp @@ -182,6 +182,12 @@ void WinscwToolChain::addToEnvironment(Utils::Environment &env) const env.prependOrSetPath(QFileInfo(m_compilerPath).absolutePath()); } + +QString WinscwToolChain::mkspec() const +{ + return QString(); // Always use default from Qt version +} + QString WinscwToolChain::makeCommand() const { #if defined Q_OS_WIN diff --git a/src/plugins/qt4projectmanager/qt-s60/winscwtoolchain.h b/src/plugins/qt4projectmanager/qt-s60/winscwtoolchain.h index bae076ec21..198b36bacf 100644 --- a/src/plugins/qt4projectmanager/qt-s60/winscwtoolchain.h +++ b/src/plugins/qt4projectmanager/qt-s60/winscwtoolchain.h @@ -60,6 +60,7 @@ public: QByteArray predefinedMacros() const; QList<ProjectExplorer::HeaderPath> systemHeaderPaths() const; void addToEnvironment(Utils::Environment &env) const; + QString mkspec() const; QString makeCommand() const; virtual QString debuggerCommand() const; QString defaultMakeTarget() const; |