Building Mac ARM/Intel Universal binaries on Mac
-
I have recently upgraded to a Qt commercial license. This has given me access to Qt 5.15.10, which supports build ARM/Intel Universal ('fat') binaries on Mac.
I am trying to build a Universal binary on my Intel iMac with:
- macOS 12.5.1
- XCode 13.4
- 'Desktop Qt 5.15.10 for macOS (Universal)' kit.
My .pro file includes:
QMAKE_APPLE_DEVICE_ARCHS = x86_64 arm64
I use macdeployqt to create the .app file.
The .app file I create runs on my Intel Mac, but not on my ARM laptop. It crashes at:
QGuiApplicationPrivate::createPlatformIntegration()
lipo -detailed_info EasyDataTransform_Universal.app/Contents/MacOS/EasyDataTransform
Gives:
Fat header in: EasyDataTransform_1_34_1_snapshot_2_Universal_2.app/Contents/MacOS/EasyDataTransform
fat_magic 0xcafebabe
nfat_arch 2
architecture x86_64
cputype CPU_TYPE_X86_64
cpusubtype CPU_SUBTYPE_X86_64_ALL
capabilities 0x0
offset 16384
size 4469408
align 2^14 (16384)
architecture arm64
cputype CPU_TYPE_ARM64
cpusubtype CPU_SUBTYPE_ARM64_ALL
capabilities 0x0
offset 4489216
size 4657312
align 2^14 (16384)But the Qt libraries don't appear to be recognized as Universal.
lipo -detailed_info EasyDataTransform_Universal.app/Contents/Frameworks/QtCore.framework/QtCore
Gives:
input file EasyDataTransform_Universal.app/Contents/Frameworks/QtCore.framework/QtCore is not a fat file
Non-fat file: EasyDataTransform_Universal.app/Contents/Frameworks/QtCore.framework/QtCore is architecture: x86_64Before I dig into this more, has anyone actually managed to build a Universal binary on an Intel Mac with Qt 5.15.10 using macdeployqt? Am I missing some magic words?
-
Since you have a commercial license, you can ask Qt Company and get priority help from them.
-
Ah, sorry then, I don't know the answer here :-(
-
I found the issue. I was using
<QtDir>/macos/bin/macdeployqt not <QtDir>/clang_64/bin/macdeployqt .