Commit 075c598f authored by Eike Ziller's avatar Eike Ziller
Browse files

Mac: Explicitly set architecture to selected tool chain.



The tool chain selection in build configurations had no effect on the
actual build, which is especially visible on Mac with universally built
Qt. The patch passes the tool chain's architecture (+bit width)
explicitly to Qmake. Users can override this behavior as usual by adding
or removing architecture flags from CONFIG in the additional arguments
field.

Task-number: QTCREATORBUG-6088
Change-Id: I92fdb7d5650db6e681945fa82e86422917f84035
Reviewed-by: default avatarTobias Hunger <tobias.hunger@nokia.com>
parent c80ec551
......@@ -59,6 +59,7 @@ Help
Platform Specific
Mac
* Pass architecture and bit width from the tool chain build setting to Qmake (QTCREATORBUG-6088)
Linux (GNOME and KDE)
......
......@@ -166,19 +166,37 @@ QString QMakeStep::allArguments(bool shorted)
///
/// moreArguments,
/// -unix for Maemo
/// -after OBJECTS_DIR, MOC_DIR, UI_DIR, RCC_DIR
/// QMAKE_VAR_QMLJSDEBUGGER_PATH
QStringList QMakeStep::moreArguments()
{
Qt4BuildConfiguration *bc = qt4BuildConfiguration();
QStringList arguments;
#if defined(Q_OS_WIN) || defined(Q_OS_MAC)
ProjectExplorer::ToolChain *tc = bc->toolChain();
if (tc && (tc->targetAbi().osFlavor() == ProjectExplorer::Abi::HarmattanLinuxFlavor
|| tc->targetAbi().osFlavor() == ProjectExplorer::Abi::MaemoLinuxFlavor))
ProjectExplorer::Abi targetAbi;
if (tc)
targetAbi = tc->targetAbi();
#if defined(Q_OS_WIN) || defined(Q_OS_MAC)
if ((targetAbi.osFlavor() == ProjectExplorer::Abi::HarmattanLinuxFlavor
|| targetAbi.osFlavor() == ProjectExplorer::Abi::MaemoLinuxFlavor))
arguments << QLatin1String("-unix");
#endif
// explicitly add architecture to CONFIG
if ((targetAbi.os() == ProjectExplorer::Abi::MacOS)
&& (targetAbi.binaryFormat() == ProjectExplorer::Abi::MachOFormat)) {
if (targetAbi.architecture() == ProjectExplorer::Abi::X86Architecture) {
if (targetAbi.wordWidth() == 32)
arguments << QLatin1String("CONFIG+=x86");
else if (targetAbi.wordWidth() == 64)
arguments << QLatin1String("CONFIG+=x86_64");
} else if (targetAbi.architecture() == ProjectExplorer::Abi::PowerPCArchitecture) {
if (targetAbi.wordWidth() == 32)
arguments << QLatin1String("CONFIG+=ppc");
else if (targetAbi.wordWidth() == 64)
arguments << QLatin1String("CONFIG+=ppc64");
}
}
if (linkQmlDebuggingLibrary() && bc->qtVersion()) {
if (!bc->qtVersion()->needsQmlDebuggingLibrary()) {
// This Qt version has the QML debugging services built in, however
......@@ -201,6 +219,7 @@ QStringList QMakeStep::moreArguments()
return arguments;
}
/// -after OBJECTS_DIR, MOC_DIR, UI_DIR, RCC_DIR
QStringList QMakeStep::moreArgumentsAfter()
{
Qt4BuildConfiguration *bc = qt4BuildConfiguration();
......
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