-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
unknown
authored and
unknown
committed
Sep 13, 2022
1 parent
4018ac5
commit 718f074
Showing
3 changed files
with
62 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# qt-aarch64 | ||
|
||
由于部分国产主机采用的是armv8架构CPU,在编译部分qt程序时会遇见版本较低的情况。软件包管理中也无法安装更新版本。于是专门编译aarch64架构下的qt,可直接下载后设置环境变量使用。 | ||
|
||
## 通用方式 | ||
|
||
目前编译好的文件分为两种形式: | ||
|
||
1. 交叉编译版本:此版能在x86_64上的Linux系统进行编译,前提需要一个交叉编译器,此处采用的是[gcc-Linaro](http://releases.linaro.org/components/toolchain/binaries/),只需下载合适版本的编译器,便可以交叉编译aarch64可执行文件。将可执行文件和库文件复制到aarch64主机上便可以运行。 | ||
|
||
|
||
目前对应的情况如下: | ||
|
||
|Ubuntu 版本|主机GCC版本|交叉编译器GCC版本| | ||
|----|----|----| | ||
|16.04|gcc-5|gcc-linaro-5.5.0-2017.10-x86_64_aarch64-linux-gnu| | ||
|18.04|gcc-7|gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu| | ||
|
||
更多等待添加... | ||
|
||
|
||
2. 本地编译版本:直接在aarch64架构主机上编译的qt,此版本设置好环境变量后直接可以使用,使用原生编译器即可。 | ||
|
||
所有的编译尽量降低了平台无关性,也可以尝试使用更高版本编译器进行编译,(让我知道哪些能用更好)。 | ||
|
||
|
||
3. 与qtcreator结合使用: 需要在qtcreator的kits中设置qmake和编译器。可以参考[看图就知道设置什么](./cross_compile_qt.md#intergrated-with-qtcreator) | ||
|
||
有能力还是别用qtcreator... 自己动手写(QtWidgets, qml)吧。我都不知道放个库上来会不会违反LGPL协议。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Native Compiled Qt Setup Guide | ||
|
||
+ Download the prebuild release. Extract the file to `/opt` | ||
|
||
```SHELL | ||
sudo tar xvf qt-5.12.12-aarch64.tar.gz -C /opt | ||
``` | ||
|
||
+ Setup enviroment | ||
|
||
```SHELL | ||
echo "export PATH=/opt/qt-5.12.12/bin:$PATH" >> ~/.bashrc | ||
source ~/.bashrc | ||
``` | ||
|
||
+ Try qmake. | ||
|
||
```SHELL | ||
qmake --version | ||
``` | ||
|
||
# Intergrated with qtcreator | ||
|
||
See [Intergrated_Guide](./cross_compile_qt.md#intergrated-with-qtcreator). | ||
|
||
|
||
**Note:** In native compile, both your binaries and libraires are aarch64 object, so feel free to use the qtcreator for building or executing. |