From 6797f9bc1502609783a8fc465e2960819ab4f38f Mon Sep 17 00:00:00 2001 From: Pierre Lamot Date: Wed, 12 Jun 2024 12:03:24 +0200 Subject: qt module: allow has_tools to specify which tools to check This allows checking for tools that may not be available in older version of qt or avoiding requesting tools that may not be necessary for a given project Co-authored-by: Nirbheek Chauhan --- docs/markdown/Qt6-module.md | 3 +++ docs/markdown/snippets/qt_has_tools_ignore.md | 12 ++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 docs/markdown/snippets/qt_has_tools_ignore.md (limited to 'docs/markdown') diff --git a/docs/markdown/Qt6-module.md b/docs/markdown/Qt6-module.md index 673b49996..7b6f94715 100644 --- a/docs/markdown/Qt6-module.md +++ b/docs/markdown/Qt6-module.md @@ -156,6 +156,9 @@ This method takes the following keyword arguments: `true` or an enabled [`feature`](Build-options.md#features) and some tools are missing Meson will abort. - `method` string: The method to use to detect Qt, see [[dependency]] +- `tools`: string[]: *Since 1.6.0*. List of tools to check. Testable tools + are `moc`, `uic`, `rcc` and `lrelease`. By default `tools` is set to `['moc', + 'uic', 'rcc', 'lrelease']` ## Dependencies diff --git a/docs/markdown/snippets/qt_has_tools_ignore.md b/docs/markdown/snippets/qt_has_tools_ignore.md new file mode 100644 index 000000000..4def48db2 --- /dev/null +++ b/docs/markdown/snippets/qt_has_tools_ignore.md @@ -0,0 +1,12 @@ +## Tools can be selected when calling `has_tools()` on the Qt modules + +When checking for the presence of Qt tools, you can now explictly ask Meson +which tools you need. This is particularly useful when you do not need +`lrelease` because you are not shipping any translations. For example: + +```meson +qt6_mod = import('qt6') +qt6_mod.has_tools(required: true, tools: ['moc', 'uic', 'rcc']) +``` + +valid tools are `moc`, `uic`, `rcc` and `lrelease`. -- cgit v1.2.3