aboutsummaryrefslogtreecommitdiff
path: root/docs/markdown
diff options
context:
space:
mode:
Diffstat (limited to 'docs/markdown')
-rw-r--r--docs/markdown/Qt5-module.md17
-rw-r--r--docs/markdown/snippets/qt5-moc_extra_arguments.md8
2 files changed, 19 insertions, 6 deletions
diff --git a/docs/markdown/Qt5-module.md b/docs/markdown/Qt5-module.md
index a8ad73d..aea2ae1 100644
--- a/docs/markdown/Qt5-module.md
+++ b/docs/markdown/Qt5-module.md
@@ -5,17 +5,22 @@ tools and steps required for Qt. The module has one method.
## preprocess
-This method takes five keyword arguments, `moc_headers`,
-`moc_sources`, `ui_files` and `qresources` which define the files that
-require preprocessing with `moc`, `uic` and `rcc` and 'include_directories' which might be needed by moc. It returns an
-opaque object that should be passed to a main build target. A simple
-example would look like this:
+This method takes the following keyword arguments:
+ - `moc_headers`, `moc_sources`, `ui_files`, `qresources`, which define the files that require preprocessing with `moc`, `uic` and `rcc`
+ - `include_directories`, the directories to add to header search path for `moc` (optional)
+ - `moc_extra_arguments`, any additional arguments to `moc` (optional). Available since v0.44.0.
+
+It returns an opaque object that should be passed to a main build target.
+
+A simple example would look like this:
```meson
qt5 = import('qt5')
qt5_dep = dependency('qt5', modules: ['Core', 'Gui'])
inc = include_directories('includes')
-moc_files = qt5.preprocess(moc_headers : 'myclass.h', include_directories: inc)
+moc_files = qt5.preprocess(moc_headers : 'myclass.h',
+ moc_extra_arguments: ['-DMAKES_MY_MOC_HEADER_COMPILE'],
+ include_directories: inc)
executable('myprog', 'main.cpp', 'myclass.cpp', moc_files,
include_directories: inc,
dependencies : qt5_dep)
diff --git a/docs/markdown/snippets/qt5-moc_extra_arguments.md b/docs/markdown/snippets/qt5-moc_extra_arguments.md
new file mode 100644
index 0000000..957c3c7
--- /dev/null
+++ b/docs/markdown/snippets/qt5-moc_extra_arguments.md
@@ -0,0 +1,8 @@
+# Adds support for additional Qt5-Module keyword `moc_extra_arguments`
+
+When `moc`-ing sources, the `moc` tool does not know about any
+preprocessor macros. The generated code might not match the input
+files when the linking with the moc input sources happens.
+
+This amendment allows to specify a a list of additional arguments
+passed to the `moc` tool. They are called `moc_extra_arguments`. \ No newline at end of file