diff options
| author | Jonathon Anderson <anderson.jonathonm@gmail.com> | 2024-07-12 22:00:46 -0500 |
|---|---|---|
| committer | Eli Schwartz <eschwartz93@gmail.com> | 2024-07-15 15:11:20 -0400 |
| commit | 6165db80bb0d014d9d1fc0d3f8a9d78e92492b94 (patch) | |
| tree | c42812167eec8dd1e14aaf8208fa2fbc98ad3882 /docs/markdown | |
| parent | b1f4e1495d4f03f4ef68d59535bd954686def3af (diff) | |
| download | meson-6165db80bb0d014d9d1fc0d3f8a9d78e92492b94.tar.gz | |
cmake: Only propagate interface link flags in dep
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.
Diffstat (limited to 'docs/markdown')
| -rw-r--r-- | docs/markdown/snippets/cmake_only_public_link_flags_in_dep.md | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/docs/markdown/snippets/cmake_only_public_link_flags_in_dep.md b/docs/markdown/snippets/cmake_only_public_link_flags_in_dep.md new file mode 100644 index 000000000..83ccfd439 --- /dev/null +++ b/docs/markdown/snippets/cmake_only_public_link_flags_in_dep.md @@ -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. |
