fix QMAKE_DEFAULT_*DIRS resolution with apple SDK, take 2
the code got factored out to an own toolchain.prf file, which is
load()ed from default_pre.prf, so no change at first.
however, on mac, we shadow toolchain.prf, and make it load() sdk.prf
first.
a side effect, it has become harder to disable the use of an sdk
altogether: putting CONFIG-=sdk into a project file or the qmake
command line has no effect now. instead, it's possible to put it into
.qmake.{conf,cache}.
to make it simpler again, it's conceivable to finally add qmake -pre,
which would allow setting variables before default_pre.prf is executed.
take 2: there was nothing wrong with the original patch, but in 5.8,
CONFIG+=simulator_and_device moved from qconfig.pri to various prf files
that would do it according to the simulator_and_device configure
feature, which would be way too late for the "pulled ahead" sdk.prf
loading. as simulator_and_device is now gone entirely, it is safe to
re-apply this patch (mostly) as-is.
Task-number: QTBUG-56144
Change-Id: I6cf484982eaed8af39f7a539c60f5a087a299914
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-10-14 11:14:13 +00:00
|
|
|
CONFIG = asset_catalogs rez $$CONFIG
|
2011-04-27 10:05:43 +00:00
|
|
|
load(default_pre)
|
|
|
|
|
2013-05-08 10:21:05 +00:00
|
|
|
isEmpty(QMAKE_XCODE_DEVELOPER_PATH) {
|
|
|
|
# Get path of Xcode's Developer directory
|
|
|
|
QMAKE_XCODE_DEVELOPER_PATH = $$system("/usr/bin/xcode-select --print-path 2>/dev/null")
|
|
|
|
isEmpty(QMAKE_XCODE_DEVELOPER_PATH): \
|
|
|
|
error("Xcode path is not set. Please use xcode-select to choose Xcode installation path.")
|
|
|
|
|
|
|
|
# Make sure Xcode path is valid
|
|
|
|
!exists($$QMAKE_XCODE_DEVELOPER_PATH): \
|
|
|
|
error("Xcode is not installed in $${QMAKE_XCODE_DEVELOPER_PATH}. Please use xcode-select to choose Xcode installation path.")
|
2017-06-07 23:42:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
isEmpty(QMAKE_XCODEBUILD_PATH): \
|
|
|
|
QMAKE_XCODEBUILD_PATH = $$system("/usr/bin/xcrun -find xcodebuild 2>/dev/null")
|
2013-05-08 10:21:05 +00:00
|
|
|
|
2017-06-07 23:42:47 +00:00
|
|
|
!isEmpty(QMAKE_XCODEBUILD_PATH) {
|
2013-05-08 10:21:05 +00:00
|
|
|
# Make sure Xcode is set up properly
|
2017-06-07 23:42:47 +00:00
|
|
|
!system("/usr/bin/xcrun xcodebuild -license check 2>/dev/null"): \
|
|
|
|
error("Xcode not set up properly. You need to confirm the license agreement by running 'sudo xcrun xcodebuild -license accept'.")
|
2013-05-08 10:21:05 +00:00
|
|
|
|
2017-06-07 23:42:47 +00:00
|
|
|
isEmpty(QMAKE_XCODE_VERSION) {
|
|
|
|
# Extract Xcode version using xcodebuild
|
|
|
|
xcode_version = $$system("/usr/bin/xcrun xcodebuild -version")
|
|
|
|
QMAKE_XCODE_VERSION = $$member(xcode_version, 1)
|
|
|
|
isEmpty(QMAKE_XCODE_VERSION): error("Could not resolve Xcode version.")
|
|
|
|
unset(xcode_version)
|
|
|
|
}
|
2013-05-08 10:21:05 +00:00
|
|
|
}
|
2013-10-14 13:09:00 +00:00
|
|
|
|
2013-10-30 14:21:04 +00:00
|
|
|
isEmpty(QMAKE_TARGET_BUNDLE_PREFIX) {
|
|
|
|
QMAKE_XCODE_PREFERENCES_FILE = $$(HOME)/Library/Preferences/com.apple.dt.Xcode.plist
|
|
|
|
exists($$QMAKE_XCODE_PREFERENCES_FILE): \
|
|
|
|
QMAKE_TARGET_BUNDLE_PREFIX = $$system("/usr/libexec/PlistBuddy -c 'print IDETemplateOptions:bundleIdentifierPrefix' $$QMAKE_XCODE_PREFERENCES_FILE 2>/dev/null")
|
|
|
|
|
|
|
|
!isEmpty(_QMAKE_CACHE_):!isEmpty(QMAKE_TARGET_BUNDLE_PREFIX): \
|
|
|
|
cache(QMAKE_TARGET_BUNDLE_PREFIX)
|
|
|
|
}
|
|
|
|
|
2016-05-04 09:08:44 +00:00
|
|
|
QMAKE_ASSET_CATALOGS_APP_ICON = AppIcon
|
|
|
|
|
2014-03-13 15:16:22 +00:00
|
|
|
# Make the default debug info format for static debug builds
|
|
|
|
# DWARF instead of DWARF with dSYM. This cuts down build times
|
|
|
|
# for application debug builds significantly, as Xcode doesn't
|
|
|
|
# have to pull out all the DWARF info from the Qt static libs
|
|
|
|
# and put it into a dSYM file. We don't need that dSYM file in
|
|
|
|
# the first place, since the information is available in the
|
|
|
|
# object files inside the archives (static libraries).
|
2016-08-05 11:35:39 +00:00
|
|
|
macx-xcode:qtConfig(static): \
|
2014-03-13 15:16:22 +00:00
|
|
|
QMAKE_XCODE_DEBUG_INFORMATION_FORMAT = dwarf
|
|
|
|
|
2013-10-25 15:00:10 +00:00
|
|
|
# This variable is used by the xcode_dynamic_library_suffix
|
2013-10-14 13:09:00 +00:00
|
|
|
# feature, which allows Xcode to choose the Qt libraries to link to
|
|
|
|
# at build time, depending on the current Xcode SDK and configuration.
|
|
|
|
QMAKE_XCODE_LIBRARY_SUFFIX_SETTING = QT_LIBRARY_SUFFIX
|