target_link_options() should work on static libraries
From the documentation of target_link_options()
:
Note: This command cannot be used to add options for static library targets, since they do not use a linker. To add archiver or MSVC librarian flags, see the
STATIC_LIBRARY_OPTIONS
target property.
It seems to me that if someone is trying to call target_link_options()
on a static library, it's fairly obvious that they mean to set STATIC_LIBRARY_OPTIONS
. CMake should do the obvious thing here.
This does become more complicated when you take scope into account. If the scope is PRIVATE
then it should set STATIC_LIBRARY_OPTIONS
. If it's INTERFACE
then it should still set INTERFACE_LINK_OPTIONS
. If it's PUBLIC
then should it set both of these?