summaryrefslogtreecommitdiffstats
path: root/Source/cmTargetLinkLibrariesCommand.h
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-06-24 17:24:50 (GMT)
committerBrad King <brad.king@kitware.com>2009-06-24 17:24:50 (GMT)
commit4266d54adbd87fe6eb64bec31441fef1920589ce (patch)
tree51c9e7e25545b6c94ab1042afb22cd73a8e6a9d4 /Source/cmTargetLinkLibrariesCommand.h
parentf74b876a58defcbdf64a9fa96d1a4ba37163fba8 (diff)
downloadCMake-4266d54adbd87fe6eb64bec31441fef1920589ce.zip
CMake-4266d54adbd87fe6eb64bec31441fef1920589ce.tar.gz
CMake-4266d54adbd87fe6eb64bec31441fef1920589ce.tar.bz2
ENH: Mention cycles in target_link_libraries docs
This documents CMake's support for cycles in the dependency graph of STATIC libraries.
Diffstat (limited to 'Source/cmTargetLinkLibrariesCommand.h')
-rw-r--r--Source/cmTargetLinkLibrariesCommand.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/Source/cmTargetLinkLibrariesCommand.h b/Source/cmTargetLinkLibrariesCommand.h
index d4c0ec2..ed0d904 100644
--- a/Source/cmTargetLinkLibrariesCommand.h
+++ b/Source/cmTargetLinkLibrariesCommand.h
@@ -107,6 +107,28 @@ public:
"the LINK_INTERFACE_LIBRARIES property. "
"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."
+ ")"
;
}