Steve,

Can you explain the need for 953def1e17f3bbba0aa42037ae15ced011d8fd2a:

    Fix DAG checker finding cycling dependencies.

    Before this patch, the following is reported falsely as a self-reference:

     target_link_libraries(empty2 LINK_PUBLIC empty3)
     target_link_libraries(empty3 LINK_PUBLIC empty2)

     add_custom_target(...
        -DINCLUDES=$<TARGET_PROPERTY:empty2,INTERFACE_INCLUDE_DIRECTORIES>
     )

    The reason is that the existing code assumed that all reading of
    include directories would be done through cmTarget::GetIncludeDirectories()
    and would therefore be initialized with a DagChecker. That is not the case
    if reading the property with an 'external' generator expression.

    As an unfortunate side-effect of backward compatibility for the
    LINK_INTERFACE_LIBRARIES property, self references can no longer be errors.

+      // It would be better to consider it an error for the foo target
+      // to have a INTERFACE_INCLUDE_DIRECTORIES which depends directly on its
+      // own INTERFACE_INCLUDE_DIRECTORIES property, but as the error of a
+      // target having itself in its own LINK_INTERFACE_LIBRARIES is 'allowed'
+      // and tested, and as the interface includes and defines are now based
+      // on the link interface, it breaks the CMakeOnly.LinkInterfaceLoop test.

?  The LinkInterfaceLoop test was added here:

 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8e756d2b

to cover a case that was accidentally allowed but that should not be used.
I'd rather not drop this great safety check for backward-compatibility
with bad code.

Can't you instead simply have the usage requirements skip appending
a target's own requirements to itself?  That way the resulting
generator expression would still not have a self reference.

-Brad
--

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

Reply via email to