parent
cb761718f0
commit
f4ea6ac454
6 changed files with 39 additions and 0 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('subdir 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') |
||||
subdir('subdir') # defines subdir_foo |
||||
|
||||
exe = executable('prog', 'main.c', link_with : [main_foo, subdir_foo]) |
||||
test('main test', exe) |
@ -0,0 +1 @@ |
||||
int meson_test_subproj_foo(void) { return 20; } |
@ -0,0 +1 @@ |
||||
subdir_foo = static_library('foo', 'foo.c', name_prefix : 'subdir') |
Loading…
Reference in new issue