Fixes the bug with flat layout and identical target names in subprojects. Without this change directories are not created with subproject prefix and they can collide. Remove dead makedirs code in Backend.__init__(), during initialization of backend build.targets is empty. Create output directories in Vs2010Backend.generate_projects() instead. Also use double blank line in run_unittests.py according to https://www.python.org/dev/peps/pep-0008/#blank-lines.pull/3252/head
parent
2e128f71bb
commit
7f042b5fe2
9 changed files with 53 additions and 14 deletions
@ -0,0 +1 @@ |
||||
int meson_test_main_foo(void) { return 10; } |
@ -0,0 +1,16 @@ |
||||
#include <stdio.h> |
||||
|
||||
int meson_test_main_foo(void); |
||||
int meson_test_subproj_foo(void); |
||||
|
||||
int main(void) { |
||||
if (meson_test_main_foo() != 10) { |
||||
printf("Failed meson_test_main_foo\n"); |
||||
return 1; |
||||
} |
||||
if (meson_test_subproj_foo() != 20) { |
||||
printf("Failed meson_test_subproj_foo\n"); |
||||
return 1; |
||||
} |
||||
return 0; |
||||
} |
@ -0,0 +1,11 @@ |
||||
project('subproject targets', 'c') |
||||
|
||||
# Idea behind this test is to create targets with identical name |
||||
# but different output files. We can do this by choosing different |
||||
# name_prefix of libraries. Target id does not depend on name_prefix. |
||||
|
||||
main_foo = static_library('foo', 'foo.c', name_prefix : 'main') |
||||
subproj_foo = subproject('subproj').get_variable('foo') |
||||
|
||||
exe = executable('prog', 'main.c', link_with : [main_foo, subproj_foo]) |
||||
test('main test', exe) |
@ -0,0 +1 @@ |
||||
int meson_test_subproj_foo(void) { return 20; } |
@ -0,0 +1,3 @@ |
||||
project('subproj', 'c') |
||||
|
||||
foo = static_library('foo', 'foo.c', name_prefix : 'subproj') |
Loading…
Reference in new issue