[cmake-developers] Should CMAKE_LINK_DEPENDS_NO_SHARED be on by default?
Matthew Woehlke
matthew.woehlke at kitware.com
Mon Feb 25 14:56:02 EST 2013
On 2013-02-25 14:00, Brad King wrote:
> On 02/25/2013 01:29 PM, Matthew Woehlke wrote:
>> On 2013-02-24 10:29, 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. Is there any reason not
>>> to enable it by default?
>>
>> What is the use case for this?
>>
>> I'm having a hard time imagining a case where it buys you anything. What
>> would cause a .so to change often that you would *not* want to re-link?
>
> The case here is that when a .so re-links its *dependents* do not
> need to be re-linked too. Since the .so is not statically linked
> into the dependents they should not need to be linked again. The
> dynamic loader will simply see the updated .so at runtime. Refer
> back to the thread I linked earlier:
>
> http://thread.gmane.org/gmane.comp.programming.tools.cmake.user/43246/focus=44469
I guess I'm still not seeing it without rereading the entire thread.
Anyway, thanks for the quick explanation.
I guess my personal opinion is that I can think of enough theoretical
ways where a relink might be needed, and haven't encountered a project
where the relink cost is sufficiently high, to feel that I would
personally want to not relink.
If CMake could somehow compare the public API that was previously
linked, versus the new flavor thereof, I would probably be more willing
to trust such an optimization. (One could also argue that this would be
a better job for the build tool.)
--
Matthew
More information about the cmake-developers
mailing list