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.pull/12340/head
parent
4fadb2a296
commit
adb1a360b9
7 changed files with 49 additions and 4 deletions
@ -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. |
@ -0,0 +1 @@ |
||||
int main(void) { return 0; } |
@ -0,0 +1,3 @@ |
||||
project('exectuable suffix', 'c') |
||||
foo = executable('foo', 'main.c') |
||||
foo_bin = executable('foo', 'main.c', name_suffix: 'bin') |
Loading…
Reference in new issue