Qt for iOS - 从源代码构建
从源代码构建Qt for iOS需要安装带有命令行工具的Xcode。您可以在终端直接使用xcode-select –install
安装 Xcode Command Line Tools,也可以使用Homebrew 作为软件包安装。您可以通过克隆软件源或下载源软件包来获取 Qt 源。
然后就可以配置和构建 Qt。这可以在 Qt 顶层目录中完成:
> ./configure -platform macx-ios-clang -release -qt-host-path <path_to_host_qt_installation>
注意: 如果ninja
可执行文件可用,则 configure 始终使用Ninja生成器和构建工具。Ninja 跨平台、功能丰富、性能卓越,建议在所有平台上使用。使用其他生成器可能可行,但未获官方支持。
有关其他配置选项,请参见Qt 配置选项。
然后,只需运行cmake --build . --parallel
。
注意: 默认构建将包括模拟器库和设备库。如果要为单一目标构建,请使用-sdk
参数和iphoneos
或iphonesimulator
。
© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.