[CMake] Redundant linking when modifying shared libraries

Itay Chamiel itay.chamiel at orcam.com
Thu Feb 14 15:12:41 EST 2019


On Thu, Feb 14, 2019 at 8:08 PM Robert Maynard
<robert.maynard at kitware.com> wrote:
> By default CMake wants to get a correct build 100% of the time. There
> is nothing to stop people from having functions defined in a .cxx file
> with no corresponding header, and using manual forward deceleration is
> used in a consuming library/executable. By setting
> `LINK_DEPENDS_NO_SHARED` to `True` you will convert what was a link
> time error ( renaming the function in the .cxx ) to a run time error.

First of all, thanks for the answer - it's good to understand the
rationale and to know that in our use case we can safely use this
setting.

On the question of whether to set this as the default, I understand
your position and I personally disagree - but do not wish to start a
debate. However I will say that this simple change has, in a common
case, reduced my build time from 5 minutes to 15 seconds. At the very
least could you consider steps to make this setting more known and
accessible? (No one on Stack Overflow knew about it, and I think
that's saying something.) Perhaps put it in a FAQ, and/or more
prominently in the documentation.

Kind regards,

itay


More information about the CMake mailing list