parent
b872eea27f
commit
67c0ec1640
8 changed files with 67 additions and 0 deletions
@ -0,0 +1,12 @@ |
|||||||
|
## `dep.as_link_whole()` |
||||||
|
|
||||||
|
Dependencies created with `declare_dependency()` now has new method `as_link_whole()`. |
||||||
|
It returns a copy of the dependency object with all link_with arguments changed |
||||||
|
to link_whole. This is useful for example for fallback dependency from a |
||||||
|
subproject built with `default_library=static`. |
||||||
|
|
||||||
|
```meson |
||||||
|
somelib = static_library('somelib', ...) |
||||||
|
dep = declare_dependency(..., link_with: somelib) |
||||||
|
library('someotherlib', ..., dependencies: dep.as_link_whole()) |
||||||
|
``` |
@ -0,0 +1,6 @@ |
|||||||
|
int bar(void); |
||||||
|
|
||||||
|
int bar(void) |
||||||
|
{ |
||||||
|
return 0; |
||||||
|
} |
@ -0,0 +1,6 @@ |
|||||||
|
int foo(void); |
||||||
|
|
||||||
|
int foo(void) |
||||||
|
{ |
||||||
|
return 0; |
||||||
|
} |
@ -0,0 +1,11 @@ |
|||||||
|
project('as-link-whole', 'c') |
||||||
|
|
||||||
|
foo = static_library('foo', 'foo.c', install: true) |
||||||
|
dep = declare_dependency(link_with: foo) |
||||||
|
bar1 = library('bar1', 'bar.c', dependencies: dep) |
||||||
|
bar2 = library('bar2', 'bar.c', dependencies: dep.as_link_whole()) |
||||||
|
|
||||||
|
# bar1.pc should have -lfoo but not bar2.pc |
||||||
|
pkg = import('pkgconfig') |
||||||
|
pkg.generate(bar1) |
||||||
|
pkg.generate(bar2) |
Loading…
Reference in new issue