aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2023-03-30 09:29:27 -0400
committerXavier Claessens <xclaesse@gmail.com>2023-08-25 09:43:24 -0400
commite3a71a7b58ac559f8669ca6fa95617a537b47f98 (patch)
treeb75a9a8c65ea3196bd743bb85b7d1a879c3d0c6a /docs
parent1bb29b1b329ec056c61a54070024b6b003cf5ca4 (diff)
downloadmeson-e3a71a7b58ac559f8669ca6fa95617a537b47f98.zip
meson-e3a71a7b58ac559f8669ca6fa95617a537b47f98.tar.gz
meson-e3a71a7b58ac559f8669ca6fa95617a537b47f98.tar.bz2
msetup: Update options when builddir is already configured
`meson setup -Dfoo=bar builddir` command was returning success ignoring new option values. This now also update options. It is useful because it means `meson setup -Dfoo=bar builddir && ninja -C builddir` works regardless whether builddir already exists or not, and when done in a script, changing options in the script will automatically trigger a reconfigure if needed. This was already possible by always passing --reconfigure argument, but that triggers a reconfigure even when options did not change.
Diffstat (limited to 'docs')
-rw-r--r--docs/markdown/Commands.md11
-rw-r--r--docs/markdown/snippets/msetup.md13
2 files changed, 24 insertions, 0 deletions
diff --git a/docs/markdown/Commands.md b/docs/markdown/Commands.md
index 75b2281..efc316c 100644
--- a/docs/markdown/Commands.md
+++ b/docs/markdown/Commands.md
@@ -244,6 +244,17 @@ Configures a build directory for the Meson project.
was no COMMAND supplied). However, supplying the command is necessary to avoid
clashes with future added commands, so "setup" should be used explicitly.
+*Since 1.1.0* `--reconfigure` is allowed even if the build directory does not
+already exist, that argument is ignored in that case.
+
+*Since 1.3.0* If the build directory already exists, options are updated with
+their new value given on the command line (`-Dopt=value`). Unless `--reconfigure`
+is also specified, this won't reconfigure immediately. This has the same behaviour
+as `meson configure <builddir> -Dopt=value`.
+
+*Since 1.3.0* It is possible to clear the cache and reconfigure in a single command
+with `meson setup --clearcache --reconfigure <builddir>`.
+
{{ setup_arguments.inc }}
See [Meson introduction
diff --git a/docs/markdown/snippets/msetup.md b/docs/markdown/snippets/msetup.md
new file mode 100644
index 0000000..f68313d
--- /dev/null
+++ b/docs/markdown/snippets/msetup.md
@@ -0,0 +1,13 @@
+## Update options with `meson setup <builddir> -Dopt=value`
+
+If the build directory already exists, options are updated with their new value
+given on the command line (`-Dopt=value`). Unless `--reconfigure` is also specified,
+this won't reconfigure immediately. This has the same behaviour as
+`meson configure <builddir> -Dopt=value`.
+
+Previous Meson versions were simply a no-op.
+
+## Clear persistent cache with `meson setup --clearcache`
+
+Just like `meson configure --clearcache`, it is now possible to clear the cache
+and reconfigure in a single command with `meson setup --clearcache --reconfigure <builddir>`.