Building QT6.4.2 for MacOS and iOS

Build QT for MacOS separately in Debug and Release configuration:

tar xf qt-everywhere-src-6.4.2.tar.xz
cd ~/build/qt
export MY_QT_SRC_DIR=~/repos/qt-everywhere-src-6.4.2
export MY_MODE=release
#export MY_MODE=debug

export MY_INSTALL_PATH=~/libs/QT6.4/${MY_MODE}/MacOs
${MY_QT_SRC_DIR}/configure -prefix $MY_INSTALL_PATH -c++std c++20 -opensource -confirm-license \
  -static -static-runtime -${MY_MODE} -force-debug-info \
  -no-openssl -securetransport -DQT_NO_EXCEPTIONS=1 \
  -skip qt3d -skip qt5compat -skip qtactiveqt -skip qtcharts -skip qtcoap -skip qtconnectivity \
  -skip qtdatavis3d -skip qtdoc -skip qtlottie -skip qtmqtt -skip qtnetworkauth -skip qtopcua \
  -skip qtserialport -skip qtpositioning -skip qtquicktimeline -skip qtquick3d -skip qtremoteobjects \
  -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtvirtualkeyboard -skip qtwayland \
  -skip qtwebchannel -skip qtwebengine -skip qtwebview -skip qtquick3dphysics -skip qtspeech -skip qtlocation \
  -skip qthttpserver \
  -- -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" \
  && cmake --build . --parallel \
  && cmake --install .

Then build QT for iOS:

cd ~/build/qt
export MY_QT_SRC_DIR=~/repos/qt-everywhere-src-6.4.2
export MY_MODE=release
#export MY_MODE=debug

export MY_HOST_PATH=~/libs/QT6.4/${MY_MODE}/MacOs
export MY_INSTALL_PATH=~/libs/QT6.4/${MY_MODE}/iOS
${MY_QT_SRC_DIR}/configure -prefix $MY_INSTALL_PATH -qt-host-path $MY_HOST_PATH \
  -platform macx-ios-clang -c++std c++20 -opensource -confirm-license \
  -static -static-runtime -$MY_MODE -force-debug-info \
  -no-openssl -securetransport -DQT_NO_EXCEPTIONS=1 \
  -skip qt3d -skip qt5compat -skip qtactiveqt -skip qtcharts -skip qtcoap -skip qtconnectivity \
  -skip qtdatavis3d -skip qtdoc -skip qtlottie -skip qtmqtt -skip qtnetworkauth -skip qtopcua \
  -skip qtserialport -skip qtpositioning -skip qtquicktimeline -skip qtquick3d -skip qtremoteobjects \
  -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtvirtualkeyboard -skip qtwayland \
  -skip qtwebchannel -skip qtwebengine -skip qtwebview -skip qtquick3dphysics -skip qtspeech -skip qtlocation \
  -skip qthttpserver \
  && cmake --build . --parallel \
  && cmake --install .

It should build with the following warnings:

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: for architecture: x86_64 file: /Users/admin/libs/QT6.4/release/MacOs/lib/libQt6Core.a(archdetect.cpp.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: for architecture: x86_64 file: /Users/admin/libs/QT6.4/release/MacOs/lib/libQt6Core.a(qiterable.cpp.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: for architecture: x86_64 file: /Users/admin/libs/QT6.4/release/MacOs/lib/libQt6Core.a(qpointer.cpp.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: for architecture: x86_64 file: /Users/admin/libs/QT6.4/release/MacOs/lib/libQt6Core.a(qstringtokenizer.cpp.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: for architecture: x86_64 file: /Users/admin/libs/QT6.4/release/MacOs/lib/libQt6Core.a(qstringview.cpp.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: for architecture: x86_64 file: /Users/admin/libs/QT6.4/release/MacOs/lib/libQt6Core.a(qrefcount.cpp.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: for architecture: x86_64 file: /Users/admin/libs/QT6.4/release/MacOs/lib/libQt6Core.a(qshareddata.cpp.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: for architecture: x86_64 file: /Users/admin/libs/QT6.4/release/MacOs/lib/libQt6Core.a(qatomic.cpp.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: for architecture: x86_64 file: /Users/admin/libs/QT6.4/release/MacOs/lib/libQt6Core.a(qexception.cpp.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: for architecture: x86_64 file: /Users/admin/libs/QT6.4/release/MacOs/lib/libQt6Core.a(qsharedmemory_posix.cpp.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: for architecture: x86_64 file: /Users/admin/libs/QT6.4/release/MacOs/lib/libQt6Core.a(qsystemsemaphore_posix.cpp.o) has no symbols

1 Response to Building QT6.4.2 for MacOS and iOS

Leave a Reply

Your email address will not be published. Required fields are marked *