Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve the Windows docs #573

Merged
merged 8 commits into from
May 3, 2023
22 changes: 19 additions & 3 deletions docs/guide/Develop_on_Windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,24 @@ This project uses variant length array, so cannot be compiled by msvs. It is rec
Developers should install such tools:

* [Qt](https://www.qt.io/download)
* only qt library for mingw 8.1.0 is needed, it is ok to use install qt5 and qt6. Other qt framework like qt script is not needed.
* recommand to install mingw 8.1.0, which can be found in tools.
* only Qt library for mingw 8.1.0 is needed, it is ok to use install Qt 5 and Qt 6 (Qt 5.15.2 is a good choice and can be adapted to mingw 8.1.0). Other Qt framework like Qt script is not needed.
* [msys environment](https://github.com/msys2/msys2-installer/releases)
* mingw 8.1.0 compiler (see below).
* It is recommended to to install mingw 8.1.0, which can be found in Qt Tools.
* xmake (see below).

Xmake can be installed either from msys pacman, or from standalone installer for windows.

It is recommended to use pacman, and other packages need to be installed in this way

```
pacman -Sy xmake
pacman -Sy cmake
da-liii marked this conversation as resolved.
Show resolved Hide resolved
pacman -Sy make
pacman -Sy git
pacman -Sy mingw-w64-x86_64-7zip
```

**CAUTIONS**: Mingw in msys pacman is too new thus imconpatible for this project. Please install mingw 8.1.0 for this project, from either Qt installer or from chocolate.

Sometimes, we need the latest xrepo:
Expand All @@ -23,8 +33,14 @@ xrepo update-repo

### Step 2: Compile
Run these command in msys environment.

```
xmake config --yes --verbose --diagnosis --plat=mingw --mingw=<newly installed qt address>/Tools/mingw810_64 --qt=<newly installed qt address>/5.x.x/mingw81_64
```

The above example is using mingw 8.1.0 installed by the Qt installer

``` bash
xmake config --qt=<newly installed qt address>/5.x.x/mingw81_64
xmake build --jobs=<numbers of processes your computer can support, same as make>
```

Expand Down
29 changes: 24 additions & 5 deletions docs/zh/guide/Develop_on_Windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,48 @@
开发者需要安装下列工具:

* [Qt](https://www.qt.io/download)
* 只需要安装适配mingw 8.1.0的qt库。Qt5和Qt6都可以安装。不需要安装Qt script等其他框架。
* 推荐安装Qt提供的mingw 8.1.0编译器,这个编译器在tools子菜单下。
* 只需要安装适配mingw 8.1.0的Qt库。Qt 5 和Qt 6 都可以安装(Qt 5.15.2是一个很好的选择,可以适配mingw 8.1.0)。不需要安装Qt script等其他框架。
* [msys environment](https://github.com/msys2/msys2-installer/releases)
* mingw 8.1.0编译器(见下文)。
* 推荐安装Qt提供的mingw 8.1.0编译器,这个编译器在Tools子目录下。
* xmake(见下文)。

既可以用msys2的pacman安装xmake,也可以用xmake的安装包来安装。

**注意**: msys提供的Mingw版本很高,与墨干的代码不兼容。请通过qt安装程序或者chocolate安装8.1.0版本的Mingw。
建议使用pacman, 同时还需要安装其他的包:

```
pacman -Sy xmake
pacman -Sy cmake
da-liii marked this conversation as resolved.
Show resolved Hide resolved
pacman -Sy make
pacman -Sy git
pacman -Sy mingw-w64-x86_64-7zip
```

**注意**: msys提供的Mingw版本很高,与墨干的代码不兼容。请通过Qt安装程序或者chocolate安装8.1.0版本的Mingw。
jingkaimori marked this conversation as resolved.
Show resolved Hide resolved

有时,开发者要更新xmake的包数据:
``` pwsh
xrepo update-repo
```

### 第二步:编译
在msys命令行下运行这两条命令
在msys命令行下运行这两条命令。

```
xmake config --yes --verbose --diagnosis --plat=mingw --mingw=<newly installed qt address>/Tools/mingw810_64 --qt=<newly installed qt address>/5.x.x/mingw81_64
```

以上示例使用的是Qt安装程序安装的Mingw 8.1.0。

``` bash
xmake config --qt=<newly installed qt address>/5.x.x/mingw81_64
xmake build --jobs=<numbers of processes your computer can support, same as make>
```

### 第三步:运行单元测试

运行命令`windeployqt`需要将你的Qt路径添加到PATH环境变量。
tangdouer1005 marked this conversation as resolved.
Show resolved Hide resolved

``` bash
windeployqt --compiler-runtime ./build/mingw/x86_64/release/ -printsupport
xmake run --yes --verbose --diagnosis --group=tests
Expand Down