| 1 |
project('declare dependency', 'c') |
| 2 |
|
| 3 |
subdir('entity') |
| 4 |
|
| 5 |
exe = executable('dep_user', 'main.c', |
| 6 |
dependencies : entity_dep) |
| 7 |
test('dep', exe) |
| 8 |
|
| 9 |
# just to make sure [] works as a no-op dep here |
| 10 |
executable('dummy', 'main.c', |
| 11 |
dependencies : [entity_dep, []]) |
| 12 |
|
| 13 |
testcase expect_error('declare_dependency keyword argument \'link_with\' was of type array[InternalDependency] but should have been array[BothLibraries | SharedLibrary | StaticLibrary | CustomTarget | CustomTargetIndex | Jar | Executable]. Dependency and external_library objects must go in the "dependencies" keyword argument') |
| 14 |
declare_dependency(link_with : entity_dep) |
| 15 |
endtestcase |
| 16 |
|
| 17 |
testcase expect_error('declare_dependency keyword argument \'link_whole\' was of type array[InternalDependency] but should have been array[BothLibraries | StaticLibrary | CustomTarget | CustomTargetIndex]. Dependency and external_library objects must go in the "dependencies" keyword argument') |
| 18 |
declare_dependency(link_whole : entity_dep) |
| 19 |
endtestcase |
| 20 |
|
| 21 |
# simple case |
| 22 |
declare_dependency(dependencies : entity_dep) |
| 23 |
|
| 24 |
# nested deps should be flattened |
| 25 |
declare_dependency(dependencies : [entity_dep]) |
| 26 |
declare_dependency(dependencies : [[entity_dep]]) |
| 27 |
|
| 28 |
# check that [] properly works as a no-op dep in declare_dependency() too |
| 29 |
declare_dependency(dependencies : []) |
| 30 |
declare_dependency(dependencies : [[]]) |
| 31 |
declare_dependency(dependencies : [entity_dep, []]) |
| 32 |
declare_dependency(dependencies : [[], entity_dep]) |