delay resolution of darwin deployment target and architectures

there appears to be no particular reason why this ended up in sdk.prf,
and it has become an actual problem now that the sdk is resolved from
default_pre.prf already, making it impossible for projects to override
the deployment target.

Task-number: QTBUG-56965
Change-Id: I8e319d10cdfb95acc1da1f431c8b8d4f76d1168e
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
This commit is contained in:
Oswald Buddenhagen 2016-12-23 15:08:39 +01:00
parent bbf7fa1368
commit afd82630c2
2 changed files with 80 additions and 80 deletions

View File

@ -24,12 +24,87 @@ qt {
}
}
macx-xcode:!isEmpty(QMAKE_XCODE_DEBUG_INFORMATION_FORMAT) {
macx-xcode {
!isEmpty(QMAKE_XCODE_DEBUG_INFORMATION_FORMAT) {
debug_information_format.name = DEBUG_INFORMATION_FORMAT
debug_information_format.value = $$QMAKE_XCODE_DEBUG_INFORMATION_FORMAT
debug_information_format.build = debug
QMAKE_MAC_XCODE_SETTINGS += debug_information_format
}
} else {
uikit {
ios: deployment_target = $$QMAKE_IOS_DEPLOYMENT_TARGET
tvos: deployment_target = $$QMAKE_TVOS_DEPLOYMENT_TARGET
watchos: deployment_target = $$QMAKE_WATCHOS_DEPLOYMENT_TARGET
device|!simulator: device_archs = $$QMAKE_APPLE_DEVICE_ARCHS
simulator: simulator_archs = $$QMAKE_APPLE_SIMULATOR_ARCHS
archs = $$device_archs $$simulator_archs
isEmpty(archs): \
error("QMAKE_APPLE_DEVICE_ARCHS or QMAKE_APPLE_SIMULATOR_ARCHS must contain at least one architecture")
QMAKE_XARCH_CFLAGS =
QMAKE_XARCH_LFLAGS =
QMAKE_EXTRA_VARIABLES += QMAKE_XARCH_CFLAGS QMAKE_XARCH_LFLAGS
single_arch {
device_archs = $$first(device_archs)
simulator_archs = $$first(simulator_archs)
archs = $$first(archs)
}
for (arch, archs) {
contains(simulator_archs, $$arch) {
sdk = $$simulator.sdk
version_identifier = $$simulator.deployment_identifier
} else {
sdk = $$device.sdk
version_identifier = $$device.deployment_identifier
}
version_min_flags = \
-Xarch_$${arch} \
-m$${version_identifier}-version-min=$$deployment_target
QMAKE_XARCH_CFLAGS_$${arch} = $$version_min_flags \
-Xarch_$${arch} \
-isysroot$$xcodeSDKInfo(Path, $$sdk)
QMAKE_XARCH_LFLAGS_$${arch} = $$version_min_flags \
-Xarch_$${arch} \
-Wl,-syslibroot,$$xcodeSDKInfo(Path, $$sdk)
QMAKE_XARCH_CFLAGS += $(EXPORT_QMAKE_XARCH_CFLAGS_$${arch})
QMAKE_XARCH_LFLAGS += $(EXPORT_QMAKE_XARCH_LFLAGS_$${arch})
QMAKE_EXTRA_VARIABLES += \
QMAKE_XARCH_CFLAGS_$${arch} \
QMAKE_XARCH_LFLAGS_$${arch}
}
QMAKE_CFLAGS_USE_PRECOMPILE =
for (arch, archs) {
QMAKE_CFLAGS_USE_PRECOMPILE += \
-Xarch_$${arch} \
-include${QMAKE_PCH_OUTPUT_$${arch}}
}
QMAKE_CXXFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE
QMAKE_OBJCFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE
QMAKE_OBJCXXFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE
QMAKE_PCH_OUTPUT_EXT = _${QMAKE_PCH_ARCH}$${QMAKE_PCH_OUTPUT_EXT}
} else {
version_identifier = macosx
deployment_target = $$QMAKE_MACOSX_DEPLOYMENT_TARGET
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 += $(EXPORT_QMAKE_XARCH_CFLAGS)
QMAKE_CXXFLAGS += $(EXPORT_QMAKE_XARCH_CFLAGS)
QMAKE_LFLAGS += $(EXPORT_QMAKE_XARCH_LFLAGS)
}
cache(QMAKE_XCODE_DEVELOPER_PATH, stash)
cache(QMAKE_XCODE_VERSION, stash)

View File

@ -47,78 +47,3 @@ for(tool, $$list(QMAKE_CC QMAKE_CXX QMAKE_FIX_RPATH QMAKE_AR QMAKE_RANLIB QMAKE_
$$tool = $$sysrooted $$member(value, 1, -1)
cache($$tool_variable, set stash, $$tool)
}
!equals(MAKEFILE_GENERATOR, XCODE) {
uikit {
ios: deployment_target = $$QMAKE_IOS_DEPLOYMENT_TARGET
tvos: deployment_target = $$QMAKE_TVOS_DEPLOYMENT_TARGET
watchos: deployment_target = $$QMAKE_WATCHOS_DEPLOYMENT_TARGET
device|!simulator: device_archs = $$QMAKE_APPLE_DEVICE_ARCHS
simulator: simulator_archs = $$QMAKE_APPLE_SIMULATOR_ARCHS
archs = $$device_archs $$simulator_archs
isEmpty(archs): \
error("QMAKE_APPLE_DEVICE_ARCHS or QMAKE_APPLE_SIMULATOR_ARCHS must contain at least one architecture")
QMAKE_XARCH_CFLAGS =
QMAKE_XARCH_LFLAGS =
QMAKE_EXTRA_VARIABLES += QMAKE_XARCH_CFLAGS QMAKE_XARCH_LFLAGS
single_arch {
device_archs = $$first(device_archs)
simulator_archs = $$first(simulator_archs)
archs = $$first(archs)
}
for(arch, archs) {
contains(simulator_archs, $$arch) {
sdk = $$simulator.sdk
version_identifier = $$simulator.deployment_identifier
} else {
sdk = $$device.sdk
version_identifier = $$device.deployment_identifier
}
version_min_flags = \
-Xarch_$${arch} \
-m$${version_identifier}-version-min=$$deployment_target
QMAKE_XARCH_CFLAGS_$${arch} = $$version_min_flags \
-Xarch_$${arch} \
-isysroot$$xcodeSDKInfo(Path, $$sdk)
QMAKE_XARCH_LFLAGS_$${arch} = $$version_min_flags \
-Xarch_$${arch} \
-Wl,-syslibroot,$$xcodeSDKInfo(Path, $$sdk)
QMAKE_XARCH_CFLAGS += $(EXPORT_QMAKE_XARCH_CFLAGS_$${arch})
QMAKE_XARCH_LFLAGS += $(EXPORT_QMAKE_XARCH_LFLAGS_$${arch})
QMAKE_EXTRA_VARIABLES += \
QMAKE_XARCH_CFLAGS_$${arch} \
QMAKE_XARCH_LFLAGS_$${arch}
}
QMAKE_CFLAGS_USE_PRECOMPILE =
for(arch, archs) {
QMAKE_CFLAGS_USE_PRECOMPILE += \
-Xarch_$${arch} \
-include${QMAKE_PCH_OUTPUT_$${arch}}
}
QMAKE_CXXFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE
QMAKE_OBJCFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE
QMAKE_OBJCXXFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE
QMAKE_PCH_OUTPUT_EXT = _${QMAKE_PCH_ARCH}$${QMAKE_PCH_OUTPUT_EXT}
} else {
version_identifier = macosx
deployment_target = $$QMAKE_MACOSX_DEPLOYMENT_TARGET
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 += $(EXPORT_QMAKE_XARCH_CFLAGS)
QMAKE_CXXFLAGS += $(EXPORT_QMAKE_XARCH_CFLAGS)
QMAKE_LFLAGS += $(EXPORT_QMAKE_XARCH_LFLAGS)
}