summaryrefslogtreecommitdiff
path: root/docs/markdown/snippets
diff options
context:
space:
mode:
authorDudemanguy <random342@airmail.cc>2023-02-22 22:09:11 -0600
committerDylan Baker <dylan@pnwbakers.com>2023-10-05 08:43:38 -0700
commitadb1a360b9f9edb26eda233326b1d539baeccd5b (patch)
tree8de1c2930bec9d5183705d6e73da04acaab035ec /docs/markdown/snippets
parent4fadb2a2962d0cdb39da7cadd5c7b1b12984eeb5 (diff)
downloadmeson-adb1a360b9f9edb26eda233326b1d539baeccd5b.tar.gz
build: use suffix when getting target id for exes
When checking target names, meson explictly forbids having multiple targets with the same name. This is good, but it is strict and it is impossible to have targets with the same basename and differing suffixes (e.g. foo and foo.bin) in the same directory. Allow this for executables by including the suffix (if it exists) in the interal target id. So foo would be foo@exe and foo.bin would be foo.bin@exe.
Diffstat (limited to 'docs/markdown/snippets')
-rw-r--r--docs/markdown/snippets/executable-suffixes.md14
1 files changed, 14 insertions, 0 deletions
diff --git a/docs/markdown/snippets/executable-suffixes.md b/docs/markdown/snippets/executable-suffixes.md
new file mode 100644
index 000000000..44471e9dd
--- /dev/null
+++ b/docs/markdown/snippets/executable-suffixes.md
@@ -0,0 +1,14 @@
+## Target names for executables now take into account suffixes.
+
+In previous versions of meson, a `meson.build` file like this:
+
+```
+exectuable('foo', 'main.c')
+exectuable('foo', 'main.c', name_suffix: 'bar')
+```
+
+would result in a configure error because meson internally used
+the same id for both executables. This build file is now allowed
+since meson takes into account the `bar` suffix when generating the
+second executable. This allows for executables with the same basename
+but different suffixes to be built in the same subdirectory.