Skip to content

Commit

Permalink
feat(build): dump the project options (#265)
Browse files Browse the repository at this point in the history
  • Loading branch information
c-dilks committed Aug 6, 2024
1 parent 95306c4 commit 319fea8
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -369,8 +369,10 @@ jobs:
-Dtest_num_events=${{ env.num_events }} \
-Dtest_output_dir=$(pwd)/validation_results \
${{ matrix.opts }}
- name: dump build options
- name: dump all build options
run: meson configure iguana_build --no-pager
- name: dump project build options
run: iguana_src/meson/dump-build-options.sh iguana_build
- run: meson compile
working-directory: iguana_build
- run: meson install
Expand Down
6 changes: 4 additions & 2 deletions doc/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,10 @@ meson configure # outputs in a pager (`less`); you may scroll, or p
meson configure --no-pager # do not use a pager
```
**but that's a _lot_ of text!** The _most important_ build options are near the bottom, under **"Project options"**.

Alternatively, see [`meson.options`](/meson.options) for the list of project options, and some more details.
To see _just_ the project options, run the following (which requires [`jq`](https://jqlang.github.io/jq/)):
```
/path/to/iguana-source/meson/dump-build-options.sh .
```

To set any build option, _e.g._ `install_examples` to `true`, run:
```bash
Expand Down
8 changes: 8 additions & 0 deletions meson/dump-build-options.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash
set -euo pipefail
if [ $# -ne 1 ]; then
echo "USAGE: $0 [BUILD_DIRECTORY]" >&2
exit 1
fi
builddir=$1
meson introspect --buildoptions $builddir | jq -r 'map(select(.section=="user") | del(.section,.machine))'

0 comments on commit 319fea8

Please sign in to comment.