CMake has two target properties, LINK_OPTIONS and INTERFACE_LINK_OPTIONS. The former is for link flags that apply only to the target (PRIVATE). The latter is used for link flags that propagate to dependents (PUBLIC or INTERFACE). Meson currently propagates all flags, PUBLIC and PRIVATE, as part of the generated dependency() which causes problems when some of the private flags are highly disruptive, e.g. `-Wl,--version-script`. Tease apart the two kinds of link flags and, for non-static libraries, only propagate the PUBLIC/INTERFACE flags and not the PRIVATE ones.pull/13429/head
parent
b1f4e1495d
commit
6165db80bb
3 changed files with 20 additions and 2 deletions
@ -0,0 +1,8 @@ |
||||
## Dependencies from CMake subprojects now use only PUBLIC link flags |
||||
|
||||
Any [[@dep]] obtained from a CMake subproject (or `.wrap` with `method = cmake`) |
||||
now only includes link flags marked in CMake as `PUBLIC` or `INTERFACE`. |
||||
Flags marked as `PRIVATE` are now only applied when building the subproject |
||||
library and not when using it as a dependency. This better matches how CMake |
||||
handles link flags and fixes link errors when using some CMake projects as |
||||
subprojects. |
Loading…
Reference in new issue