With executable(), if the link_with argument has a string as one of it's elements, meson ends up throwing an AttributeError exception: ... File "/home/lyudess/Projects/meson/mesonbuild/build.py", line 868, in link if not t.is_linkable_target(): AttributeError: 'str' object has no attribute 'is_linkable_target' Which is not very helpful in figuring out where exactly the project is trying to link against a string instead of an actual link target. So, fix this by verifying in BuildTarget.link() that each given target is actually a Target object and not something else. Additionally, add a simple test case for this in failing tests. At the moment, this test case just passes unconditionally due to meson throwing the AttributeError exception and failing as expected. However, this test case will be useful eventually if we ever end up making failing tests more strict about failing gracefully (per advice of QuLogic).pull/2482/merge
parent
6e406ed0db
commit
1a159db8e9
3 changed files with 5 additions and 0 deletions
@ -0,0 +1,2 @@ |
||||
project('string as link argument', 'c') |
||||
executable('myprog', 'prog.c', link_with: [ '' ]) |
@ -0,0 +1 @@ |
||||
int main(int argc, char **argv) { return 0; } |
Loading…
Reference in new issue