Skip to content

Simplify target link libraries

The implementation of target_link_libraries did grow over the years when new features where added.
This MR cleans up the implementation and adds comments to better document its intention.

The behavior of target_link_libraries is left untouched with two small exceptions:

  • CMaking stops earlier with a fatal error if this command is used to link to a target that was not created in the current directory. (This might result in some other errors with the command no longer showing until that error is resolved.)
  • Some error-messages are slightly adjusted to better tell what invocation would be correct instead.
Edited by Deniz Bahadir

Merge request reports