forked from mesonbuild/meson
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
InternalDependency: Add as_link_whole() method
- Loading branch information
Showing
8 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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()) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
int bar(void); | ||
|
||
int bar(void) | ||
{ | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
int foo(void); | ||
|
||
int foo(void) | ||
{ | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |