Skip to content

Conversation

@matt-sm
Copy link
Contributor

@matt-sm matt-sm commented May 20, 2025

Currently the meson rule will always set LDFLAGS to flags.cxx_linker_executable.

If there are any executable-specific flags eg. -pie in that list, any meson shared_library() will fail to link.

Cmake has a feature whereby you can set target-specific linker flags eg. CMAKE_CXX_LINK_EXECUTABLE. Meson does not have a similar concept: upstream issue

This MR adds a new shared_ldflags_option attribute to the meson rule that will add shared flags to a build option with the specified name. This attribute follows the make shared_ldflags_vars pattern.

Additional change: the options values are not currently expanded. This PR also adds location expansion to this attr.

Update: due to nothing ever being merged in this repo, I've had to combine this with #1428 due to conflicts.

@matt-sm matt-sm marked this pull request as ready for review May 21, 2025 22:51
@matt-sm matt-sm marked this pull request as draft May 25, 2025 10:08
@matt-sm matt-sm marked this pull request as ready for review May 25, 2025 22:47
@matt-sm matt-sm marked this pull request as draft May 30, 2025 01:35
@matt-sm matt-sm force-pushed the meson-ldflags branch 6 times, most recently from 5870486 to 9462307 Compare June 17, 2025 05:09
@matt-sm matt-sm marked this pull request as ready for review June 18, 2025 01:03
@matt-sm matt-sm marked this pull request as draft June 20, 2025 00:48
@matt-sm matt-sm force-pushed the meson-ldflags branch 3 times, most recently from c094ca7 to c991b44 Compare June 20, 2025 03:08
@matt-sm matt-sm changed the title meson: use common ldflags meson: add a shared_ldflags_option arg Jul 7, 2025
@matt-sm matt-sm changed the title meson: add a shared_ldflags_option arg meson: add a shared_ldflags_option attr Jul 7, 2025
@matt-sm matt-sm marked this pull request as ready for review July 8, 2025 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant