On Fri, Oct 18, 2019, at 11:55 AM, Fred Baksik wrote:
> 
> In target_link_libraries it states that "The library dependency graph is 
> normally acyclic (a DAG)". I recall from my own experience that the DAG is 
> not always created the same way when generating the project. It has to do 
> with the way with this part of CMake is implemented (C++ containers and that 
> sort of thing) so while all the inputs are the same the order is Not the same 
> so it produces a different DAG which changed the ordering of the components 
> build order which also altered the link order.
> 
> For the GHS Generator to ensure that the exact same project files are output 
> we sorted the components by name into a vector first (instead of just using a 
> set) before supplying it to this algorithm. Then the results were always the 
> same.
> 

Sorry, I wanted to clarify this a bit. The DAG is correct. For example lets say 
A depends on B and C and then C on D. This DAG always comes out the same. But 
when you try to extract the dependents of A it sometimes returns something that 
will give you B then C or C then B when accessing them in a linear order. So 
there were differences if you inspected these items with the debugger.

When I ran across these kinds of things with the GHS Generator we sort things 
in lexicographical order to produce the same results every time.

Best regards,
Fred
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake

Reply via email to