構建 Qt for iOS 從源要求 Xcode 采用命令行工具安裝。這在 Xcode 可以做到從 首選項 > 下載 > 組件 > 命令行工具 .
Qt sources can be obtained either by cloning the repositories or downloading the source package(s).
We can then configure and build Qt. This is done from the Qt top directory:
> ./configure -platform macx-ios-clang -release -qt-host-path <path_to_host_qt_installation>
注意:
configure always uses the
Ninja
generator and build tool if a
ninja
executable is available. Ninja is cross-platform, feature-rich, performant, and recommended on all platforms. The use of other generators might work but is not officially supported.
其它配置選項,見 Qt 配置選項 .
然後,隻需運行
cmake --build . --parallel
.
注意:
默認構建將包括模擬器和設備庫。若想要構建單個目標,使用
-sdk
自變量采用
iphoneos
or
iphonesimulator
.