From 58aa301accc2dc1f107c2e77b8187de94fb1bd0c Mon Sep 17 00:00:00 2001 From: Tristan Partin Date: Mon, 5 Jun 2023 09:30:37 -0500 Subject: Override find_program('meson') This override transparently upgrades anyone using it to this better functionality. Fixes #8511 --- .../snippets/override-find-program-meson.md | 38 ++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 docs/markdown/snippets/override-find-program-meson.md (limited to 'docs/markdown/snippets') diff --git a/docs/markdown/snippets/override-find-program-meson.md b/docs/markdown/snippets/override-find-program-meson.md new file mode 100644 index 0000000..5d281cd --- /dev/null +++ b/docs/markdown/snippets/override-find-program-meson.md @@ -0,0 +1,38 @@ +## New override of `find_program('meson')` + +In some cases, it has been useful for build scripts to access the Meson command +used to invoke the build script. This has led to various ad-hoc solutions that +can be very brittle and project-specific. + +```meson +meson_prog = find_program('meson') +``` + +This call will supply the build script with an external program pointing at the +invoked Meson. + +Because Meson also uses `find_program` for program lookups internally, this +override will also be handled in cases similar to the following: + +```meson +custom_target( + # ... + command: [ + 'meson', + ], + # ... +) + +run_command( + 'meson', + # ... +) + +run_target( + 'tgt', + command: [ + 'meson', + # ... + ] +) +``` -- cgit v1.1