[Cmake-commits] [cmake-commits] king committed cmTargetLinkLibrariesCommand.h 1.20 1.21

cmake-commits at cmake.org cmake-commits at cmake.org
Wed Jun 24 13:24:53 EDT 2009


Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv13585/Source

Modified Files:
	cmTargetLinkLibrariesCommand.h 
Log Message:
ENH: Mention cycles in target_link_libraries docs

This documents CMake's support for cycles in the dependency graph of
STATIC libraries.


Index: cmTargetLinkLibrariesCommand.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmTargetLinkLibrariesCommand.h,v
retrieving revision 1.20
retrieving revision 1.21
diff -C 2 -d -r1.20 -r1.21
*** cmTargetLinkLibrariesCommand.h	2 Feb 2009 14:42:23 -0000	1.20
--- cmTargetLinkLibrariesCommand.h	24 Jun 2009 17:24:50 -0000	1.21
***************
*** 108,111 ****
--- 108,133 ----
        "Libraries specified as \"general\" (or without any keyword) are "
        "treated as if specified for both \"debug\" and \"optimized\"."
+       "\n"
+       "The library dependency graph is normally acyclic (a DAG), but in the "
+       "case of mutually-dependent STATIC libraries CMake allows the graph "
+       "to contain cycles (strongly connected components).  "
+       "When another target links to one of the libraries CMake repeats "
+       "the entire connected component.  "
+       "For example, the code\n"
+       "  add_library(A STATIC a.c)\n"
+       "  add_library(B STATIC b.c)\n"
+       "  target_link_libraries(A B)\n"
+       "  target_link_libraries(B A)\n"
+       "  add_executable(main main.c)\n"
+       "  target_link_libraries(main A)\n"
+       "links 'main' to 'A B A B'.  "
+       "("
+       "While one repetition is usually sufficient, pathological object "
+       "file and symbol arrangements can require more.  "
+       "One may handle such cases by manually repeating the component in "
+       "the last target_link_libraries call.  "
+       "However, if two archives are really so interdependent they should "
+       "probably be combined into a single archive."
+       ")"
        ;
      }



More information about the Cmake-commits mailing list