parent
dad5779d3c
commit
5bc1009109
5 changed files with 39 additions and 2 deletions
@ -0,0 +1,13 @@ |
|||||||
|
# Added `if_found` to subdir |
||||||
|
|
||||||
|
Added a new keyword argument to the `subdir` command. It is given a |
||||||
|
list of dependency objects and the function will only recurse in the |
||||||
|
subdirectory if they are all found. Typical usage goes like this. |
||||||
|
|
||||||
|
d1 = dependency('foo') # This is found |
||||||
|
d2 = dependency('bar') # This is not found |
||||||
|
|
||||||
|
subdir('somedir', if_found : [d1, d2]) |
||||||
|
|
||||||
|
In this case the subdirectory would not be entered since `d2` could |
||||||
|
not be found. |
@ -0,0 +1,11 @@ |
|||||||
|
project('subdir if found', 'c') |
||||||
|
|
||||||
|
found_dep = declare_dependency() |
||||||
|
not_found_dep = dependency('nonexisting', required : false) |
||||||
|
|
||||||
|
subdir('nonexisting_dir', if_found : not_found_dep) |
||||||
|
|
||||||
|
variable = 3 |
||||||
|
|
||||||
|
subdir('subdir', if_found : found_dep) |
||||||
|
assert(variable == 5, 'Subdir was not properly entered.') |
@ -0,0 +1 @@ |
|||||||
|
variable = 5 |
Loading…
Reference in new issue