[cmake-developers] Order of linking libraries

J Decker d3ck0r at gmail.com
Wed Jan 22 06:52:35 EST 2014

It's in the same order as it is specified; if the same configuration
options are used, it should be the same list always.
IF things are somehow installed differently maybe; but the installed
libraries should still be located in the same order.

It is the same order for all generators.
The order of objects is always the order they are specified.

On Wed, Jan 22, 2014 at 2:31 AM, Marcin Maslany <marcinmaslany at gmail.com> wrote:
> Hello,
> what's the order of linking libraries? Is it always deterministic? I know it
> is possible to build dependency graph on libraries with cmake and find the
> correct order with topological sorting (this might be the way you do it).
> However, when I check the output from two builds (one after another) using
> cmake I can see that order is not always the same. I mean when I compare
> phrases "Linking C/CXX static library ..". Even if I run make with only one
> job.
> I totally agree that it still produces the correct binary, but I'd like to
> know if it's possible to ensure that the linking order of libraries is (no
> matter what machine I am running it on) deterministic? Of course, other than
> adding fake dependencies.
> I am just courius what is the reason of different order, even if I use the
> same machine to build binary.
> BR, Marcin Maslany
> --
> Powered by www.kitware.com
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers

More information about the cmake-developers mailing list