summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2020-06-24 20:48:16 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2020-06-24 20:50:30 +0530
commit86a235c584e0f54a4726187950b0bcbde7379ae2 (patch)
tree7139007358b3a9ba722ad0ebe5de58adbbcd09c3
parentd42cd735a4dc894d8e898a5f9e81029f6eb5364c (diff)
downloadmeson-nirbheek/document-path-building.tar.gz
docs: Document string path building with examplesnirbheek/document-path-building
Also document that line continuation didn't work before 0.50. 90c9b868b20b11bb089fc5e0c634d5ed76fea0cb fixed it.
-rw-r--r--docs/markdown/Syntax.md25
1 files changed, 22 insertions, 3 deletions
diff --git a/docs/markdown/Syntax.md b/docs/markdown/Syntax.md
index 666d50e59..e3a810eaf 100644
--- a/docs/markdown/Syntax.md
+++ b/docs/markdown/Syntax.md
@@ -16,9 +16,10 @@ statements* and *includes*.
Usually one Meson statement takes just one line. There is no way to
have multiple statements on one line as in e.g. *C*. Function and
method calls' argument lists can be split over multiple lines. Meson
-will autodetect this case and do the right thing. In other cases you
-can get multi-line statements by ending the line with a `\`. Apart
-from line ending whitespace has no syntactic meaning.
+will autodetect this case and do the right thing.
+
+In other cases, *(added 0.50)* you can get multi-line statements by ending the
+line with a `\`. Apart from line ending whitespace has no syntactic meaning.
Variables
--
@@ -136,6 +137,24 @@ str2 = 'xyz'
combined = str1 + '_' + str2 # combined is now abc_xyz
```
+#### String path building
+
+*(Added 0.49)*
+
+You can concatenate any two strings using `/` as an operator to build paths.
+This will always use `/` as the path separator on all platforms.
+
+```meson
+joined = '/usr/share' / 'projectname' # => /usr/share/projectname
+joined = '/usr/local' / '/etc/name' # => /etc/name
+
+joined = 'C:\\foo\\bar' / 'builddir' # => C:/foo/bar/builddir
+joined = 'C:\\foo\\bar' / 'D:\\builddir' # => D:/builddir
+```
+
+Note that this is equivalent to using [`join_paths()`](Reference-manual.md#join_paths),
+which is deprecated.
+
#### Strings running over multiple lines
Strings running over multiple lines can be declared with three single