diff options
author | Jon Turney <jon.turney@dronecode.org.uk> | 2020-05-23 17:04:30 +0100 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2020-09-29 19:22:50 +0300 |
commit | ff186b05261210602490ea4764e5ccfa2ec494fc (patch) | |
tree | ddab6cefcf4fdbc97831bea4dfe83175c5dd8099 | |
parent | be2598a4e208860762b081e8398f6abbf6158a1c (diff) | |
download | meson-ff186b05261210602490ea4764e5ccfa2ec494fc.zip meson-ff186b05261210602490ea4764e5ccfa2ec494fc.tar.gz meson-ff186b05261210602490ea4764e5ccfa2ec494fc.tar.bz2 |
Improve documentation about using shell in custom_target() [skip ci]
Add a note about the portability of using shell constructs in the
custom_target() command.
-rw-r--r-- | docs/markdown/Custom-build-targets.md | 9 | ||||
-rw-r--r-- | docs/markdown/Reference-manual.md | 4 |
2 files changed, 9 insertions, 4 deletions
diff --git a/docs/markdown/Custom-build-targets.md b/docs/markdown/Custom-build-targets.md index f0b50d8..76bf939 100644 --- a/docs/markdown/Custom-build-targets.md +++ b/docs/markdown/Custom-build-targets.md @@ -29,14 +29,15 @@ it does for source generation. See [Generating Sources](Generating-sources.md) for more information on this topic. -## Details on compiler invocations +## Details on command invocation Meson only permits you to specify one command to run. This is by design as writing shell pipelines into build definition files leads to -code that is very hard to maintain. If your compilation requires +code that is very hard to maintain. If your command requires multiple steps you need to write a wrapper script that does all the -necessary work. When doing this you need to be mindful of the -following issues: +necessary work. + +When doing this you need to be mindful of the following issues: * do not assume that the command is invoked in any specific directory * a target called `target` file `outfile` defined in subdir `subdir` diff --git a/docs/markdown/Reference-manual.md b/docs/markdown/Reference-manual.md index c289397..1d0bb92 100644 --- a/docs/markdown/Reference-manual.md +++ b/docs/markdown/Reference-manual.md @@ -397,6 +397,10 @@ the following special string substitutions: The returned object also has methods that are documented in the [object methods section](#custom-target-object) below. +**Note:** Assuming that `command:` is executed by a POSIX `sh` shell is not +portable, notably to Windows. Instead, consider using a `native: true` +[executable()](#executable), or a python script. + ### declare_dependency() ``` meson |