|
@@ -0,0 +1,91 @@
|
|
|
|
|
+# qt build
|
|
|
|
|
+## qmake.conf
|
|
|
|
|
+```
|
|
|
|
|
+export PATH=/opt/arm-gnu-toolchain-11.3.rel1-x86_64-aarch64-none-linux-gnu/bin:$PATH
|
|
|
|
|
+```
|
|
|
|
|
+- `qtbase/mkspecs/linux-aarch64-gnu-g++/qmake.conf`
|
|
|
|
|
+```
|
|
|
|
|
+#
|
|
|
|
|
+# qmake configuration for building with aarch64-linux-gnu-g++
|
|
|
|
|
+#
|
|
|
|
|
+
|
|
|
|
|
+MAKEFILE_GENERATOR = UNIX
|
|
|
|
|
+CONFIG += incremental
|
|
|
|
|
+QMAKE_INCREMENTAL_STYLE = sublib
|
|
|
|
|
+
|
|
|
|
|
+include(../common/linux.conf)
|
|
|
|
|
+include(../common/gcc-base-unix.conf)
|
|
|
|
|
+include(../common/g++-unix.conf)
|
|
|
|
|
+
|
|
|
|
|
+# modifications to g++.conf
|
|
|
|
|
+QMAKE_CC = aarch64-none-linux-gnu-gcc
|
|
|
|
|
+QMAKE_CXX = aarch64-none-linux-gnu-g++
|
|
|
|
|
+QMAKE_LINK = aarch64-none-linux-gnu-g++
|
|
|
|
|
+QMAKE_LINK_SHLIB = aarch64-none-linux-gnu-g++
|
|
|
|
|
+
|
|
|
|
|
+# modifications to linux.conf
|
|
|
|
|
+QMAKE_AR = aarch64-none-linux-gnu-ar cqs
|
|
|
|
|
+QMAKE_OBJCOPY = aarch64-none-linux-gnu-objcopy
|
|
|
|
|
+QMAKE_NM = aarch64-none-linux-gnu-nm -P
|
|
|
|
|
+QMAKE_STRIP = aarch64-none-linux-gnu-strip
|
|
|
|
|
+load(qt_config)
|
|
|
|
|
+```
|
|
|
|
|
+## configure options
|
|
|
|
|
+- `-xplatform`<br>
|
|
|
|
|
+使用自定义的mkspec (qtbase/mkspecs/)
|
|
|
|
|
+- `-skip <repo>`<br>
|
|
|
|
|
+`-skip <repo>` 的 `<repo` 名字指的是 Qt 的子仓库`(repository)`名称,也就是 Qt 各个模块在源码树中的顶层目录名称。<br>
|
|
|
|
|
+在 `Qt` 源码根目录下执行:
|
|
|
|
|
+```bash
|
|
|
|
|
+ls -d qt*/
|
|
|
|
|
+```
|
|
|
|
|
+示例输出
|
|
|
|
|
+```bash
|
|
|
|
|
+qt3d/ qtcanvas3d/ qtdeclarative/ qtimageformats/ qtnetworkauth/ qtremoteobjects/ qtserialbus/ qttools/ qtwebchannel/ qtwebview/
|
|
|
|
|
+qtactiveqt/ qtcharts/ qtdoc/ qtlocation/ qtpurchasing/ qtscript/ qtserialport/ qttranslations/ qtwebengine/ qtwinextras/
|
|
|
|
|
+qtandroidextras/ qtconnectivity/ qtgamepad/ qtmacextras/ qtquickcontrols/ qtscxml/ qtspeech/ qtvirtualkeyboard/ qtwebglplugin/ qtx11extras/
|
|
|
|
|
+qtbase/ qtdatavis3d/ qtgraphicaleffects/ qtmultimedia/ qtquickcontrols2/ qtsensors/ qtsvg/ qtwayland/ qtwebsockets/ qtxmlpatterns/
|
|
|
|
|
+```
|
|
|
|
|
+| 仓库名 | 功能说明 | 嵌入式建议 |
|
|
|
|
|
+| ---------------------------------------- | --------------------------------------------------- | -------------------------- |
|
|
|
|
|
+| **qtbase/** | Qt 核心库,包括 GUI、核心类、事件循环、网络、线程、QtCore、QtGui、QtWidgets | ✅ 必须 |
|
|
|
|
|
+| **qtdeclarative/** | QML / Qt Quick 引擎 | ✅ 必须(界面开发) |
|
|
|
|
|
+| **qtquickcontrols/** | Qt Quick Controls 1(老版控件库) | ⚙️ 可选,一般用 qtquickcontrols2 |
|
|
|
|
|
+| **qtquickcontrols2/** | Qt Quick Controls 2(现代 QML 控件库) | ✅ 推荐 |
|
|
|
|
|
+| **qtsvg/** | SVG 渲染支持 | ⚙️ 推荐,如果界面需要 SVG 图标 |
|
|
|
|
|
+| **qttools/** | Qt 工具,如 `lrelease`, `moc`, `rcc` 等 | ✅ 需要工具编译 |
|
|
|
|
|
+| **qtmultimedia/** | 音视频、摄像头、音频播放接口 | ⚙️ 按需启用 |
|
|
|
|
|
+| **qtserialport/** | 串口支持 | ✅ 嵌入式常用 |
|
|
|
|
|
+| **qtserialbus/** | 串口总线(CAN/Modbus 等) | ⚙️ 可选 |
|
|
|
|
|
+| **qtsensors/** | 传感器接口(加速度计、陀螺仪等) | ⚙️ 按需启用 |
|
|
|
|
|
+| **qtconnectivity/** | 蓝牙、NFC、网络连接管理 | ⚙️ 可选 |
|
|
|
|
|
+| **qtgamepad/** | 游戏手柄接口 | ❌ 嵌入式一般不启用 |
|
|
|
|
|
+| **qt3d/** | 3D 图形和场景管理 | ❌ 一般不启用 |
|
|
|
|
|
+| **qtdatavis3d/** | 3D 数据可视化 | ❌ 一般不启用 |
|
|
|
|
|
+| **qtcharts/** | 2D 图表控件 | ⚙️ 按需启用 |
|
|
|
|
|
+| **qtpositioning/** (在 5.12.12 有时叫 gypsy) | 地理定位 | ⚙️ 按需启用 |
|
|
|
|
|
+| **qtlocation/** | 地图和位置服务 | ❌ 嵌入式一般不启用 |
|
|
|
|
|
+| **qtwebengine/** | Chromium 内核,浏览器组件 | ❌ 太大,不推荐嵌入式使用 |
|
|
|
|
|
+| **qtwebview/** | 简单 WebView 组件 | ❌ 嵌入式一般不启用 |
|
|
|
|
|
+| **qtwebchannel/** | QML/JS 与 C++ 通信 | ⚙️ 按需启用 |
|
|
|
|
|
+| **qtwebsockets/** | WebSocket 支持 | ⚙️ 按需启用 |
|
|
|
|
|
+| **qtwebglplugin/** | QtQuick → WebGL 导出插件 | ❌ 嵌入式一般不启用 |
|
|
|
|
|
+| **qtwinextras/** | Windows 特定接口 | ❌ 跳过 |
|
|
|
|
|
+| **qtmacextras/** | macOS 特定接口 | ❌ 跳过 |
|
|
|
|
|
+| **qtandroidextras/** | Android 特定接口 | ❌ 跳过(RK3588 Linux 不用) |
|
|
|
|
|
+| **qtscxml/** | SCXML 状态机支持 | ⚙️ 可选 |
|
|
|
|
|
+| **qtscript/** | QtScript 脚本支持 | ⚙️ 可选,Qt5 已被废弃 |
|
|
|
|
|
+| **qtpurchasing/** | 商店购买 API | ❌ 跳过 |
|
|
|
|
|
+| **qtdoc/** | 官方文档 | ❌ 跳过 |
|
|
|
|
|
+| **qttranslations/** | 国际化文件 | ⚙️ 可选 |
|
|
|
|
|
+| **qtgraphicaleffects/** | QML 图形效果(阴影、模糊等) | ⚙️ 推荐 |
|
|
|
|
|
+| **qtimageformats/** | PNG/JPG/TIFF/WebP 等图片格式插件 | ✅ 必须 |
|
|
|
|
|
+| **qtvirtualkeyboard/** | 虚拟键盘 | ⚙️ 如果嵌入式需要屏幕键盘启用 |
|
|
|
|
|
+| **qtxmlpatterns/** | XPath/XQuery/Xml schema 支持 | ⚙️ 按需启用 |
|
|
|
|
|
+| **qtcanvas3d/** | WebGL 风格 3D Canvas(QtQuick3D 的前身) | ❌ 一般不启用 |
|
|
|
|
|
+| **qtactiveqt/** | COM / ActiveX 接口(Windows) | ❌ 跳过 |
|
|
|
|
|
+| **qtnetworkauth/** | OAuth 网络认证 | ⚙️ 按需启用 |
|
|
|
|
|
+| **qtremoteobjects/** | 分布式对象同步(网络共享对象) | ⚙️ 可选 |
|
|
|
|
|
+| **qtspeech/** | TTS / 语音 | ⚙️ 按需启用 |
|
|
|
|
|
+| **qtx11extras/** | X11 平台扩展 | ⚙️ 仅 X11 平台用 |
|
|
|
|
|
+| **qtwayland/** | Wayland 平台支持 | ⚙️ 嵌入式可启用(Wayland 后端) |
|