From 07d2d88fa9bd4f3598f9212b7209f98443b636d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20=C3=81vila=20de=20Esp=C3=ADndola?= Date: Sun, 19 Aug 2018 08:19:11 -0700 Subject: Allow override_find_program to use an executable. With this it is now possible to do foobar = executable('foobar', ...) meson.override_find_program('foobar', foobar) Which is convenient for a project like protobuf which produces both a dependency and a tool. If protobuf is updated to use override_find_program, it can be used as protobuf_dep = dependency('protobuf', version : '>=3.3.1', fallback : ['protobuf', 'protobuf_dep']) protoc_prog = find_program('protoc') --- docs/markdown/Reference-manual.md | 4 +++- docs/markdown/snippets/overrideexe.md | 8 ++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 docs/markdown/snippets/overrideexe.md (limited to 'docs') diff --git a/docs/markdown/Reference-manual.md b/docs/markdown/Reference-manual.md index ea11f60..9762c5d 100644 --- a/docs/markdown/Reference-manual.md +++ b/docs/markdown/Reference-manual.md @@ -1529,7 +1529,9 @@ the following methods. specifies that whenever `find_program` is used to find a program named `progname`, Meson should not not look it up on the system but instead return `program`, which may either be the result of - `find_program` or `configure_file`. + `find_program`, `configure_file` or `executable`. + + If `program` is an `executable`, it cannot be used during configure. - `project_version()` returns the version string specified in `project` function call. diff --git a/docs/markdown/snippets/overrideexe.md b/docs/markdown/snippets/overrideexe.md new file mode 100644 index 0000000..59213c5 --- /dev/null +++ b/docs/markdown/snippets/overrideexe.md @@ -0,0 +1,8 @@ +## More flexible `override_find_program()`. + +It is now possible to pass an `executable` to +`override_find_program()` if the overridden program is not used during +configure. + +This is particularly useful for fallback dependencies like Protobuf +that also provide a tool like protoc. -- cgit v1.1