iOS: Don't mangle QT_ARCH when being more specific about what arch to build
On iOS the compiler expects archs like armv6, armv7, armv7s when passed the -arch flag, or when the ARCHS Xcode variable is set. Instead of mangling QT_ARCH, which is used other places and assumed to match the values provided by the arch.test, we use our own variable. Change-Id: I05e10be8d69dd4d7cbcef04640fef99f1efb253d Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
This commit is contained in:
parent
60fbb00d59
commit
35d0e9b66f
@ -46,24 +46,27 @@ isEmpty(QT_ARCH) {
|
|||||||
# but we fail to pick up the architecture since we're not passing -arch
|
# but we fail to pick up the architecture since we're not passing -arch
|
||||||
# yet. Xcode does not seem to have a way to run the shared toolchain
|
# yet. Xcode does not seem to have a way to run the shared toolchain
|
||||||
# in a way that will automatically do this (for example xcrun -sdk).
|
# in a way that will automatically do this (for example xcrun -sdk).
|
||||||
contains(QMAKE_MAC_SDK, iphoneos.*): QT_ARCH = armv7
|
contains(QMAKE_MAC_SDK, iphoneos.*): QT_ARCH = arm
|
||||||
else: QT_ARCH = i386 # Simulator
|
else: QT_ARCH = i386 # Simulator
|
||||||
|
}
|
||||||
|
|
||||||
|
# Be more specific about which architecture we're targeting
|
||||||
|
equals(QT_ARCH, arm): \
|
||||||
|
actual_archs = armv7
|
||||||
|
else: \
|
||||||
|
actual_archs = $$QT_ARCH
|
||||||
|
|
||||||
|
equals(MAKEFILE_GENERATOR, XCODE) {
|
||||||
|
QMAKE_XCODE_ARCHS = $$actual_archs
|
||||||
} else {
|
} else {
|
||||||
# Fix up the QT_ARCH to be more specific
|
for(arch, actual_archs): \
|
||||||
equals(QT_ARCH, arm) {
|
arch_flags += -arch $$arch
|
||||||
# Samsung S5PC100, Apple A4, A5, A5X
|
|
||||||
QT_ARCH = armv7
|
|
||||||
|
|
||||||
# FIXME: How do we support armv7s when Qt can't do universal builds?
|
QMAKE_CFLAGS += $$arch_flags
|
||||||
}
|
QMAKE_CXXFLAGS += $$arch_flags
|
||||||
}
|
QMAKE_OBJECTIVE_CFLAGS += $$arch_flags
|
||||||
|
QMAKE_LFLAGS += $$arch_flags
|
||||||
!equals(MAKEFILE_GENERATOR, XCODE) {
|
|
||||||
arch_flag = -arch $$QT_ARCH
|
|
||||||
QMAKE_CFLAGS += $$arch_flag
|
|
||||||
QMAKE_CXXFLAGS += $$arch_flag
|
|
||||||
QMAKE_OBJECTIVE_CFLAGS += $$arch_flag
|
|
||||||
QMAKE_LFLAGS += $$arch_flag
|
|
||||||
}
|
}
|
||||||
|
unset(actual_archs)
|
||||||
|
|
||||||
load(default_post)
|
load(default_post)
|
||||||
|
@ -1409,7 +1409,8 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
|
|||||||
+ fixListForOutput("QMAKE_LIBS_PRIVATE"),
|
+ fixListForOutput("QMAKE_LIBS_PRIVATE"),
|
||||||
SettingsAsList, 6) << ";" << "\n";
|
SettingsAsList, 6) << ";" << "\n";
|
||||||
}
|
}
|
||||||
const ProStringList &archs = project->values("QT_ARCH");
|
const ProStringList &archs = !project->values("QMAKE_XCODE_ARCHS").isEmpty() ?
|
||||||
|
project->values("QMAKE_XCODE_ARCHS") : project->values("QT_ARCH");
|
||||||
if (!archs.isEmpty())
|
if (!archs.isEmpty())
|
||||||
t << "\t\t\t\t" << writeSettings("ARCHS", archs) << ";" << "\n";
|
t << "\t\t\t\t" << writeSettings("ARCHS", archs) << ";" << "\n";
|
||||||
if (!project->isEmpty("OBJECTS_DIR"))
|
if (!project->isEmpty("OBJECTS_DIR"))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user