[cmake-developers] Should CMAKE_LINK_DEPENDS_NO_SHARED be on by default?

Brad King brad.king at kitware.com
Mon Feb 25 08:53:41 EST 2013


On 02/24/2013 10:29 AM, Stephen Kelly wrote:
> CMAKE_LINK_DEPENDS_NO_SHARED was introduced in this cycle, but off by 
> default. It seems useful enough to be on by default.

For reference, it was introduced in this thread:

http://thread.gmane.org/gmane.comp.programming.tools.cmake.user/43246/focus=44469

> Is there any reason not to enable it by default?

It is a change in default behavior.  The current behavior was
introduced a long time ago after some very subtle breakage
occurred due to not re-linking dependents.  However, the
current behavior also makes everyone pay a cost in the common
case to support the potentially rare cases where not re-linking
is wrong.  Unfortunately I do not remember enough detail about
the original case to argue about whether it could be common
(IIRC it had something to do with moving a .cxx from one shared
library to another without changing any headers).

If the option were to be on by default then instead there
should be the reverse option off by default with a name like:

 CMAKE_LINK_DEPENDS_SHARED_LIBRARIES

Otherwise we will ask every target to carry around a property
setting just to get default behavior.

-Brad



More information about the cmake-developers mailing list