summaryrefslogtreecommitdiffstats
path: root/Source/cmComputeLinkDepends.cxx
Commit message (Collapse)AuthorAgeFilesLines
* cmState: Move TargetType enum from cmTarget.Stephen Kelly2015-10-141-2/+2
| | | | | | | Mostly automated: values=( "EXECUTABLE" "STATIC_LIBRARY" "SHARED_LIBRARY" "MODULE_LIBRARY" "OBJECT_LIBRARY" "UTILITY" "GLOBAL_TARGET" "INTERFACE_LIBRARY" "UNKNOWN_LIBRARY" "TargetType") for i in "${values[@]}"; do git grep -l cmTarget::$i | xargs sed -i "s|cmTarget::$i|cmState::$i|g"; done
* cmTarget: Move link type enum out.Stephen Kelly2015-10-141-8/+8
| | | | Remove a reason for generate time code to depend on the cmTarget header/type.
* cmLinkItem: Port to cmGeneratorTarget.Stephen Kelly2015-10-121-7/+3
|
* cmGeneratorTarget: Move FindTargetToLink from cmTarget.Stephen Kelly2015-10-121-3/+4
|
* cmComputeLinkDepends: Port result API to cmGeneratorTarget.Stephen Kelly2015-10-121-1/+2
|
* cmGeneratorTarget: Port GetLinkInterface away from cmTarget.Stephen Kelly2015-10-101-3/+3
|
* cmComputeLinkDepends: Port some API to cmGeneratorTarget.Stephen Kelly2015-10-101-16/+14
|
* Merge topic 'use-generator-target'Brad King2015-08-271-9/+15
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | c2b7336f cmGeneratorTarget: Move GetConfigCommonSourceFiles from cmTarget. 69329fff cmGeneratorTarget: Move GetLanguages from cmTarget. 0431f2c4 cmGeneratorTarget: Move ComputeLinkImplementationLanguages from cmTarget. abe9505d cmGeneratorTarget: Move HaveBuildTreeRPath from cmTarget. d4a24c0e cmGeneratorTarget: Move GetLinkImplementation from cmTarget. 83981cf5 cmTarget: Add GetLinkImplMap method. 771e79a2 cmLinkItem: Add cmOptionalLinkImplementation type. 3846ebcf cmLinkItem: Add cmLinkImplementation type. a7f5d70d cmGeneratorTarget: Move compile defintions processing from cmTarget. d051086c cmGeneratorTarget: Move compile features processing from cmTarget. db4cb92b cmGeneratorTarget: Move compile options processing from cmTarget. e6ccbf6f cmGeneratorTarget: Move include directory processing from cmTarget. 8bfb0c53 cmGeneratorTarget: Move link iface helpers from cmTarget. 2cb3e574 cmGeneratorTarget: Move GetImportLinkInterface from cmTarget. 6d3d099b cmGeneratorTarget: Move ComputeLinkInterfaceLibraries from cmTarget. 0db9d927 cmGeneratorTarget: Move GetLinkInterfaceLibraries from cmTarget. ...
| * cmGeneratorTarget: Move GetLinkImplementation from cmTarget.Stephen Kelly2015-08-261-1/+1
| |
| * cmLinkItem: Add cmLinkImplementation type.Stephen Kelly2015-08-261-1/+1
| |
| * cmGeneratorTarget: Move GetLinkInterface from cmTarget.Stephen Kelly2015-08-261-3/+9
| |
| * cmTarget: Move link interface libraries struct out.Stephen Kelly2015-08-261-4/+4
| |
* | Reduce uses of cmMakefile::GetGlobalGenerator.Stephen Kelly2015-08-251-1/+3
|/ | | | Don't assume the cmMakefile has a global generator.
* Remove use of include <cmsys/stl/*> and cmsys_stl::*Brad King2015-08-201-2/+0
| | | | We no longer need this compatibility layer for the compilers we support.
* cmComputeLinkDepends: Port to cmGeneratorTarget.Stephen Kelly2015-08-051-8/+9
|
* cmComputeLinkDepends: Remove unused local generator.Stephen Kelly2015-05-031-3/+1
|
* Include cmAlgorithms where it is used.Stephen Kelly2015-03-101-0/+1
|
* Convert some raw loops to cmWrap.Stephen Kelly2015-02-201-4/+1
|
* cmComputeLinkDepends: Remove temporary iterator copy.Stephen Kelly2015-02-061-2/+1
|
* Remove use of cmsys_stl.Stephen Kelly2015-02-051-3/+3
| | | | It is not needed.
* Convert raw loops to vector member insert.Stephen Kelly2015-01-181-5/+2
|
* Use the cmDeleteAll algorithm instead of trivial raw loops.Stephen Kelly2015-01-131-6/+1
|
* Merge topic 'drop-ancient-workarounds'Brad King2015-01-121-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 0f7bdd61 Remove VS 6 special case. 5e92c826 Remove some obsolete stuff. 15e42bb2 cmStandardIncludes: Remove obsolete cmOStringStream. 931e055d Port all cmOStringStream to std::ostringstream. f194a009 Remove unused cmIStringStream class. 3ec1bb15 cmStandardIncludes: Remove std namespace hack. bb3bce70 cmStandardIncludes: Remove ANSI_FOR_SCOPE hack. 28fa4923 cmStandardIncludes: Remove iostreams workaround for obsolete Compaq compiler. 837a8a63 cmStandardIncludes: Drop Comeau-related workaround. 4030ddfd Remove Borland-related undef. 17d6a6fd cmStandardIncludes: Remove comment about Borland. 26fb5011 Drop SGI as a CMake host compiler.
| * Port all cmOStringStream to std::ostringstream.Stephen Kelly2015-01-111-1/+1
| | | | | | | | All compilers hosting CMake support the std class.
* | Revert "Misc. fixes for the Oracle / Sun compiler."Stephen Kelly2015-01-111-3/+2
|/ | | | This reverts commit 97b65f8156734db2adc367b27c822a5fe332d740.
* Misc. fixes for the Oracle / Sun compiler.Chuck Atkins2014-12-121-2/+3
| | | | | | A few pieces of code have some ambiguous type deduction that seems to resolve correctly for most compilers but not for the Oracle compiler. This makes those few instances more explicit.
* Fix link line order when shared libraries are de-duplicatedDaniele E. Domenichelli2014-11-101-4/+9
| | | | | | | | | | | | | | | | | | | | Since commit v3.1.0-rc1~227^2~1 (De-duplicate shared library targets in generated link lines, 2014-07-30) we de-duplicate shared library targets on the link line. However, some toolchains will fail linking if an executable is linking to a shared library that is not used directly and a static library that depends on the shared one. The linker may not keep the reference to the shared library the first time and then the symbols needed by the static library may not be found. Fix this by reversing the direction of the for loop that removes the duplicate shared libraries, in order to ensure that the last occurrence of the library is left instead of the first one. Extend Tests/Dependency with a case covering this behavior. Create an executable that links to a shared library and a static library but only needs the shared library as a dependency of the static library. Co-Author: Brad King <brad.king@kitware.com>
* De-duplicate shared library targets in generated link linesBrad King2014-07-301-2/+13
| | | | | | | | | | The linker will bring in shared libraries as a whole and use them even for symbols that are needed by entries later in the link line. Therefore we do not need to repeat them. De-duplicate link entries that we know are shared libraries because we have a cmTarget associated with them. Tested-by: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>
* cmComputeLinkDepends: Convert AddLinkEntries to a templateBrad King2014-07-071-2/+3
| | | | | Allow the method to be called with a vector of any type that can be converted to cmLinkItem.
* cmTarget: Lookup targets in LinkInterface and LinkImplementationBrad King2014-06-231-24/+22
| | | | | | | | | | | | | | | Instead of storing just the string names in these structures, lookup any target associated with each item and store its cmTarget pointer. Use the cmLinkItem class to hold the name and pointer together. Update client sites to use the pre-stored lookup result instead of looking up the target name again. Create a cmTarget::LookupLinkItems helper method to handle the lookup. Since lookups are now moving from cmComputeLinkDepends::AddLinkEntries to cmTarget::LookupLinkItems, move use of CheckCMP0004 to the latter. This drops use of CheckCMP0004 from entries added for _LIB_DEPENDS variables by cmComputeLinkDepends::AddVarLinkEntries, but I do not think that use was intentional originally anyway.
* cmTarget: Add method to lookup other targets in a target's scopeBrad King2014-06-231-28/+3
| | | | | Move the main implementation of cmComputeLinkDepends::FindTargetToLink into cmTarget.
* cmTarget: Remove 'head' argument from GetLinkImplementationBrad King2014-06-231-1/+1
| | | | | | | | | | | | | Many of the 'head' arguments added by commit v2.8.11~289^2~1 (Make linking APIs aware of 'head' target, 2013-01-04) turned out not to be needed. The "link implementation" of a target never needs to be computed with anything but itself as the 'head' target (except for CMP0022 OLD behavior because then it is the link interface). Remove the unused 'head' target paths. Add "internal" versions of cmTarget::GetDirectLinkLibraries and GetLinkImplementationLibraries to support the CMP0022 OLD behavior without otherwise exposing the 'head' target option of these methods.
* cmComputeLinkInformation: Remove 'head' argumentBrad King2014-06-231-7/+5
| | | | | | It is only ever constructed with the current target as its own 'head'. Co-Author: Stephen Kelly <steveire@gmail.com>
* cmComputeLinkDepends: Simplify CheckWrongConfigItem implementationBrad King2014-06-231-6/+3
| | | | Combine the outer two if() conditions into a single one with &&.
* Remove some c_str() calls.Stephen Kelly2014-03-111-5/+5
| | | | | | Use the clang RemoveCStrCalls tool to automatically migrate the code. This was only run on linux, so does not have any positive or negative effect on other platforms.
* stringapi: Pass configuration names as stringsBen Boeckel2014-03-081-3/+4
|
* strings: Remove cmStdString referencesBen Boeckel2014-03-081-5/+5
| | | | | | | | | | | Casts from std::string -> cmStdString were high on the list of things taking up time. Avoid such implicit casts across function calls by just using std::string everywhere. The comment that the symbol name is too long is no longer relevant since modern debuggers alias the templates anyways and the size is a non-issue since the underlying methods are generated since it's inherited.
* stringapi: Use strings in target nameBen Boeckel2014-03-081-4/+5
|
* Constify handling of link targets.Stephen Kelly2013-12-111-5/+6
|
* cmTarget: Make GetProperty() const.Stephen Kelly2013-10-311-1/+2
| | | | | | This has follow-on effects for other methods and classes. Further work on making the use of const cmTarget pointers common can be done, particularly with a view to generate-time methods.
* Add the INTERFACE_LIBRARY target type.Stephen Kelly2013-10-071-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | This target type only contains INTERFACE_* properties, so it can be used as a structural node. The target-specific commands enforce that they may only be used with the INTERFACE keyword when used with INTERFACE_LIBRARY targets. The old-style target properties matching LINK_INTERFACE_LIBRARIES_<CONFIG> are always ignored for this target type. The name of the INTERFACE_LIBRARY must match a validity generator expression. The validity is similar to that of an ALIAS target, but with the additional restriction that it may not contain double colons. Double colons will carry the meaning of IMPORTED or ALIAS targets in CMake 2.8.13. An ALIAS target may be created for an INTERFACE library. At this point it can not be exported and does not appear in the buildsystem and project files are not created for them. That may be added as a feature in a later commit. The generators need some changes to handle the INTERFACE_LIBRARY targets returned by cmComputeLinkInterface::GetItems. The Ninja generator does not use that API, so it doesn't require changes related to that.
* Make linking APIs aware of 'head' targetStephen Kelly2013-01-081-5/+6
| | | | | | | | | | | The 'head' is the dependent target to be linked with the current target. It will be used to evaluate generator expressions with proper handling of mapped configurations and is used as the source target of properties. This requires that memoization is done with a key of a pair of target and config, instead of just config, because now the result also depends on the target. Removing the memoization entirely is not an option because it slows cmake down considerably.
* Add OBJECT_LIBRARY target typeBrad King2012-03-131-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | This library type can compile sources to object files but does not link or archive them. It will be useful to reference from executable and normal library targets for direct inclusion of object files in them. Diagnose and reject the following as errors: * An OBJECT library may not be referenced in target_link_libraries. * An OBJECT library may contain only compiling sources and supporting headers and custom commands. Other source types that are not normally ignored are not allowed. * An OBJECT library may not have PRE_BUILD, PRE_LINK, or POST_BUILD commands. * An OBJECT library may not be installed, exported, or imported. Some of these cases may be supported in the future but are not for now. Teach the VS generator that OBJECT_LIBRARY targets are "linkable" just like STATIC_LIBRARY targets for the LinkLibraryDependencies behavior.
* Run vim spellcheck on some filesYury G. Kudryashov2012-02-291-3/+3
|
* Tolerate cycles in shared library link interfaces (#12647)Brad King2012-01-131-3/+19
| | | | | | | | | | | | | Since commit 183b9509 (Follow all dependencies of shared library private dependencies, 2011-12-14) we honor LINK_INTERFACE_LIBRARIES when following dependent shared libraries. The link interface properties may form a cycle if set incorrectly by a project. Furthermore, the property LINK_DEPENDENT_LIBRARIES may form a cycle if set incorrectly by hand (though CMake should never generate one). In either case, do not follow the cycle forever when following the dependent shared library closure. We only need to add dependency edges to the constraint graph once. Add "LinkInterfaceLoop" test to cover this case.
* Follow all dependencies of shared library private dependenciesBrad King2011-12-141-1/+2
| | | | | | | | | In cmComputeLinkDepends we compute the transitive closure of private shared library dependencies. When a shared library is added to this closure we must follow all of its dependencies whether they are private or public. Previously we only followed the private dependencies. Fix the implementation to follow the public dependencies too. Also extend the ExportImport test to cover this case.
* Documentation: Fix spelling / formatting errors (#12287)Modestas Vainius2011-06-191-1/+1
| | | | | | | | | | | | | | The patch fixes the following problems spotted by lintian: W: cmake-data: manpage-has-errors-from-man usr/share/man/man1/cmakemodules.1.gz 2641: warning [p 39, 1.5i]: can't break line I: cmake-data: spelling-error-in-manpage usr/share/man/man1/cmakeprops.1.gz explict explicit I: cmake: spelling-error-in-binary usr/bin/cmake explict explicit I: cmake: spelling-error-in-binary usr/bin/cpack explict explicit I: cmake: spelling-error-in-binary usr/bin/ctest explict explicit W: cmake: manpage-has-errors-from-man usr/share/man/man1/cmake.1.gz 7300: warning [p 120, 3.3i]: can't break line I: cmake: spelling-error-in-manpage usr/share/man/man1/cmake.1.gz explict explicit I: cmake-curses-gui: spelling-error-in-binary usr/bin/ccmake explict explicit I: cmake-qt-gui: spelling-error-in-binary usr/bin/cmake-gui explict explicit
* Distinguish "strong" and "weak" target dependency edgesBrad King2010-08-251-1/+2
| | | | | | Utility dependencies are "strong" because they must be enforced to generate a working build. Link dependencies are "weak" because they can be broken in the case of a static library cycle.
* Split notion of node lists and edge listsBrad King2010-08-251-10/+10
|
* Convert CMake to OSI-approved BSD LicenseBrad King2009-09-281-14/+9
| | | | | | | This converts the CMake license to a pure 3-clause OSI-approved BSD License. We drop the previous license clause requiring modified versions to be plainly marked. We also update the CMake copyright to cover the full development time range.