aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatryk Obara <dreamer.tan@gmail.com>2021-03-28 20:16:08 +0200
committerGitHub <noreply@github.com>2021-03-28 21:16:08 +0300
commit1db49240c6491416d7e1c87bdec19bf401d9b7c5 (patch)
treeaa45fdae8b0184ece0d5f1233a4e3a1a721dbc67
parent268a78f0f473c1b5193e8b44a067030b74a6559d (diff)
downloadmeson-1db49240c6491416d7e1c87bdec19bf401d9b7c5.zip
meson-1db49240c6491416d7e1c87bdec19bf401d9b7c5.tar.gz
meson-1db49240c6491416d7e1c87bdec19bf401d9b7c5.tar.bz2
docs: Provide working instructions for scan-build [skip ci]
Replace `meson compile scan-build` with `ninja -C dir scan-build`, because scan-build target does not work with `meson compile`. Note about SCANBUILD env variable was not precise enough to describe how to pass arguments to scan-build - provide an example to make it clear. Fixes: #7644.
-rw-r--r--docs/markdown/howtox.md20
1 files changed, 17 insertions, 3 deletions
diff --git a/docs/markdown/howtox.md b/docs/markdown/howtox.md
index 8c8c0c0..1521f72 100644
--- a/docs/markdown/howtox.md
+++ b/docs/markdown/howtox.md
@@ -211,19 +211,33 @@ test failures.
## Use Clang static analyzer
-Install scan-build and configure your project. Then do this:
+Install scan-build program, then do this:
```console
-$ meson compile scan-build
+$ meson setup builddir
+$ ninja -C builddir scan-build
```
You can use the `SCANBUILD` environment variable to choose the
scan-build executable.
```console
-$ SCANBUILD=<your exe> meson compile scan-build
+$ SCANBUILD=<your exe> ninja -C builddir scan-build
```
+You can use it for passing arguments to scan-build program by
+creating a script, for example:
+
+```sh
+#!/bin/sh
+scan-build -v --status-bugs "$@"
+```
+
+And then pass it through the variable (remember to use absolute path):
+
+```console
+$ SCANBUILD=$(pwd)/my-scan-build.sh ninja -C builddir scan-build
+```
## Use profile guided optimization