2022-05-14 17:39:13 +08:00
|
|
|
CONFIG = asset_catalogs rez $$CONFIG
|
2023-05-05 09:20:25 +08:00
|
|
|
|
|
|
|
macos {
|
|
|
|
count(QT_ARCHS, 1, >) {
|
|
|
|
# For universal builds all the config tests are run with the first
|
|
|
|
# architecture (as reflected by QT_ARCH). We have to manually enable
|
|
|
|
# CPU features we know exist on the secondary architecture. For
|
|
|
|
# simplicity we just hard-code the base features we know exist.
|
|
|
|
# Note that this hack means we end up with QT_CPU_FEATURES.x86_64
|
|
|
|
# containing neon, and QT_CPU_FEATURES.arm64 containing sse2 e.g.
|
|
|
|
QT_CPU_FEATURES.$$QT_ARCH += sse sse2
|
|
|
|
CONFIG += sse sse2
|
|
|
|
DEFINES += QT_COMPILER_SUPPORTS_SSE2
|
|
|
|
# FIXME: For x86_64 there are a bunch more. If building a universal
|
|
|
|
# build with arm64 as the primary architecture we'll miss those.
|
|
|
|
|
|
|
|
QT_CPU_FEATURES.$$QT_ARCH += neon
|
|
|
|
CONFIG += neon
|
|
|
|
DEFINES += QT_COMPILER_SUPPORTS_NEON
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-05-14 17:39:13 +08:00
|
|
|
load(default_pre)
|
|
|
|
|
|
|
|
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.")
|
|
|
|
}
|
|
|
|
|
|
|
|
isEmpty(QMAKE_XCODEBUILD_PATH): \
|
|
|
|
QMAKE_XCODEBUILD_PATH = $$system("/usr/bin/xcrun -find xcodebuild 2>/dev/null")
|
|
|
|
|
|
|
|
!isEmpty(QMAKE_XCODEBUILD_PATH) {
|
|
|
|
# Make sure Xcode is set up properly
|
|
|
|
!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'.")
|
|
|
|
|
|
|
|
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)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
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)
|
|
|
|
}
|
|
|
|
|
|
|
|
QMAKE_ASSET_CATALOGS_APP_ICON = AppIcon
|
|
|
|
|
|
|
|
# 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).
|
|
|
|
macx-xcode:qtConfig(static): \
|
|
|
|
QMAKE_XCODE_DEBUG_INFORMATION_FORMAT = dwarf
|
|
|
|
|
|
|
|
# This variable is used by the xcode_dynamic_library_suffix
|
|
|
|
# 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
|
|
|
|
|
|
|
|
xcode_copy_phase_strip_setting.name = COPY_PHASE_STRIP
|
|
|
|
xcode_copy_phase_strip_setting.value = NO
|
|
|
|
QMAKE_MAC_XCODE_SETTINGS += xcode_copy_phase_strip_setting
|