Skip to content

Commit 508c8ce

Browse files
authored
docs: add qt_host option documentation (#199)
1 parent 645c6d7 commit 508c8ce

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

guide/project_examples.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,20 @@ However, it is usually necessary to specify the SDK path yourself.
302302
$ xmake f --qt=[Qt SDK]
303303
```
304304

305+
#### Cross-Platform Qt Builds
306+
307+
For cross-platform Qt development, xmake supports using separate SDKs for host tools and the target platform. This is particularly useful when building Qt applications for a different platform than your development machine.
308+
309+
The `--qt_host` option allows you to specify the location of Qt tools that are compatible with your build machine, while `--qt` points to the SDK for the target platform:
310+
311+
```bash
312+
$ xmake f --qt=[target Qt sdk] --qt_host=[host Qt sdk]
313+
```
314+
315+
**Important considerations**:
316+
- Make sure the host and target Qt versions match, or it may cause build issues.
317+
- Native deployment tools like `windeployqt` and `macdeployqt` must run on their respective platforms, so cross-platform tasks such as `xmake install` may fail.
318+
305319
#### Qt packages from the xmake-repo repository
306320

307321
xmake now officially provides a variety of modules for the Qt5 SDK that can be integrated automatically without any manual installation.

0 commit comments

Comments
 (0)