构建 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
.