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

Brad King brad.king at kitware.com
Mon Feb 25 15:46:08 EST 2013


On 02/25/2013 03:09 PM, dlrdave at aol.com wrote:
> 
>> Can you elaborate on some of the theoretical cases where relinking
>> will be needed but no header files have changed?  It would be useful
>> to have them available for discussion.
> I can think of one, but it’s probably not that common:
>  
> A header file declares a function prototype, but there is no implementation of it.
>  
> When it’s discovered, when somebody finally tries to add an implementation, you only have the change the C++ file to add it.
>  
> Of course, for the caller that discovers this, it had never linked successfully in the first place, and would relink after that rebuild anyhow...
>  
> But for other callers that had never discovered it, though, a relink may be necessary in case the ordinals of some of the *other* functions in the dll changed due to the addition of one in the middle.
>  
> Uncommon, but possible.

Actually for DLL platforms the dependency goes on the import library,
and some toolchains may not touch the import library if it has not
changed.  Perhaps we should not make this option affect DLL platforms.
Some investigation into Windows toolchain behavior may be needed.

-Brad



More information about the cmake-developers mailing list