parent
d5b0673079
commit
4deeb907b6
5 changed files with 33 additions and 3 deletions
@ -0,0 +1,8 @@ |
||||
## Dependencies with multiple names |
||||
|
||||
More than one name can now be passed to `dependency()`, they will be tried in order |
||||
and the first name to be found will be used. The fallback subproject will be |
||||
used only if none of the names are found on the system. Once one of the name has |
||||
been found, all other names are added into the cache so subsequent calls for any |
||||
of those name will return the same value. This is useful in case a dependency |
||||
could have different names, such as `png` and `libpng`. |
@ -0,0 +1,10 @@ |
||||
project('dependency fallbacks', 'c') |
||||
|
||||
# pkg-config has 'libpng' but cmake has 'png' and we have a 'png' subproject |
||||
# for platforms that have neither. |
||||
d = dependency('libpng', 'png', 'foo') |
||||
assert(d.found()) |
||||
|
||||
# Check that dependency 'foo' has been implicitly overriden. |
||||
d = dependency('foo') |
||||
assert(d.found()) |
@ -0,0 +1,3 @@ |
||||
project('png') |
||||
|
||||
meson.override_dependency('libpng', declare_dependency()) |
Loading…
Reference in new issue