aboutsummaryrefslogtreecommitdiff
path: root/docs/markdown
diff options
context:
space:
mode:
Diffstat (limited to 'docs/markdown')
-rw-r--r--docs/markdown/Reference-manual.md6
-rw-r--r--docs/markdown/snippets/cross_find.md15
2 files changed, 21 insertions, 0 deletions
diff --git a/docs/markdown/Reference-manual.md b/docs/markdown/Reference-manual.md
index 3f25e80..34b473d 100644
--- a/docs/markdown/Reference-manual.md
+++ b/docs/markdown/Reference-manual.md
@@ -466,6 +466,12 @@ Keyword arguments are the following:
then use the `.found()` method on the returned object to check
whether it was found or not.
+- `native` defines how this executable should be searched. By default
+ it is set to `false`, which causes Meson to first look for the
+ executable in the cross file (when cross building) and if it is not
+ defined there, then from the system. If set to `true`, the cross
+ file is ignored and the program is only searched from the system.
+
Meson will also autodetect scripts with a shebang line and run them
with the executable/interpreter specified in it both on Windows
(because the command invocator will reject the command otherwise) and
diff --git a/docs/markdown/snippets/cross_find.md b/docs/markdown/snippets/cross_find.md
new file mode 100644
index 0000000..b16d64d
--- /dev/null
+++ b/docs/markdown/snippets/cross_find.md
@@ -0,0 +1,15 @@
+# Can override executables in the cross file
+
+The cross file can now be used for overriding the result of
+`find_program`. As an example if you want to find the `objdump`
+command and have the following definition in your cross file:
+
+ [binaries]
+ ...
+ objdump = '/usr/bin/arm-linux-gnueabihf-objdump-6'
+
+Then issuing the command `find_program('objdump')` will return the
+version specified in the cross file. If you need the build machine's
+objdump, you can specify the `native` keyword like this:
+
+ native_objdump = find_program('objdump', native : true)