diff options
Diffstat (limited to 'docs/markdown')
-rw-r--r-- | docs/markdown/snippets/install_emptydir.md | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/docs/markdown/snippets/install_emptydir.md b/docs/markdown/snippets/install_emptydir.md new file mode 100644 index 0000000..baedf58 --- /dev/null +++ b/docs/markdown/snippets/install_emptydir.md @@ -0,0 +1,18 @@ +## install_emptydir function + +It is now possible to define a directory which will be created during +installation, without creating it as a side effect of installing files into it. +This replaces custom `meson.add_install_script()` routines. For example: + +```meson +meson.add_install_script('sh', '-c', 'mkdir -p "$DESTDIR/@0@"'.format(path)) +``` + +can be replaced by: + +```meson +install_emptydir(path) +``` + +and as a bonus this works reliably on Windows, prints a sensible progress +message, will be uninstalled by `ninja uninstall`, etc. |