Fix isysroot for simulator only builds on ios

When not doing fat builds, QMAKE_MAC_SDK_PATH defaults
to iphoneos sysroot, which breaks compilation.

This fixes compilation when user sets also CONFIG-=device

Change-Id: I1d18269946cd2a5608e26d943159c824f31db09a
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
bb10
Michal Klocek 2020-01-13 13:23:52 +01:00
parent 95d5a8e74f
commit 7d7ba311e0
1 changed files with 8 additions and 5 deletions

View File

@ -212,14 +212,17 @@ macx-xcode {
QMAKE_CXXFLAGS += $(EXPORT_QMAKE_XARCH_CFLAGS)
QMAKE_LFLAGS += $(EXPORT_QMAKE_XARCH_LFLAGS)
} else {
simulator: \
simulator {
version_identifier = $$simulator.deployment_identifier
else: \
sysroot_path = $$xcodeSDKInfo(Path, $$simulator.sdk)
} else {
version_identifier = $$device.deployment_identifier
sysroot_path = $$xcodeSDKInfo(Path, $$device.sdk)
}
version_min_flag = -m$${version_identifier}-version-min=$$deployment_target
QMAKE_CFLAGS += -isysroot $$QMAKE_MAC_SDK_PATH $$version_min_flag
QMAKE_CXXFLAGS += -isysroot $$QMAKE_MAC_SDK_PATH $$version_min_flag
QMAKE_LFLAGS += -Wl,-syslibroot,$$QMAKE_MAC_SDK_PATH $$version_min_flag
QMAKE_CFLAGS += -isysroot $$sysroot_path $$version_min_flag
QMAKE_CXXFLAGS += -isysroot $$sysroot_path $$version_min_flag
QMAKE_LFLAGS += -Wl,-syslibroot,$$sysroot_path $$version_min_flag
}
# Enable precompiled headers for multiple architectures