summaryrefslogtreecommitdiffstats
path: root/Source/cmComputeLinkDepends.h
Commit message (Collapse)AuthorAgeFilesLines
* use CM_NULLPTRDaniel Pfeifer2016-06-281-1/+1
|
* Revise C++ coding style using clang-formatKitware Robot2016-05-161-13/+27
| | | | | | | | | | | | | Run the `Utilities/Scripts/clang-format.bash` script to update all our C++ code to a new style defined by `.clang-format`. Use `clang-format` version 3.8. * If you reached this commit for a line in `git blame`, re-run the blame operation starting at the parent of this commit to see older history for the content. * See the parent commit for instructions to rebase a change across this style transition commit.
* Format include directive blocks and ordering with clang-formatBrad King2016-04-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sort include directives within each block (separated by a blank line) in lexicographic order (except to prioritize `sys/types.h` first). First run `clang-format` with the config file: --- SortIncludes: false ... Commit the result temporarily. Then run `clang-format` again with: --- SortIncludes: true IncludeCategories: - Regex: 'sys/types.h' Priority: -1 ... Commit the result temporarily. Start a new branch and cherry-pick the second commit. Manually resolve conflicts to preserve indentation of re-ordered includes. This cleans up the include ordering without changing any other style. Use the following command to run `clang-format`: $ git ls-files -z -- \ '*.c' '*.cc' '*.cpp' '*.cxx' '*.h' '*.hh' '*.hpp' '*.hxx' | egrep -z -v '(Lexer|Parser|ParserHelper)\.' | egrep -z -v '^Source/cm_sha2' | egrep -z -v '^Source/(kwsys|CursesDialog/form)/' | egrep -z -v '^Utilities/(KW|cm).*/' | egrep -z -v '^Tests/Module/GenerateExportHeader' | egrep -z -v '^Tests/RunCMake/CommandLine/cmake_depends/test_UTF-16LE.h' | xargs -0 clang-format -i This selects source files that do not come from a third-party. Inspired-by: Daniel Pfeifer <daniel@pfeifer-mail.de>
* Source: Stabilize include orderBrad King2016-04-291-1/+1
| | | | | Each source file has a logical first include file. Include it in an isolated block so that tools that sort includes do not move them.
* Remove some obsolete declarationsStephen Kelly2015-10-271-1/+0
| | | | | | | | | | | | | Ensure that cmStandardIncludes.h is included before any platform header in cmGeneratorExpressionEvaluator.h. That file needs to change as a result of removal of the cmMakefile.h header from cmGeneratorExpressionNode.h, affecting the compilation of cmGeneratorExpressionNode.cxx. On AIX we need to include our own headers first to get large file support macros defined consistently within system headers. The old order in this header worked only because it was always included after other headers.
* cmTarget: Move link type enum out.Stephen Kelly2015-10-141-1/+1
| | | | Remove a reason for generate time code to depend on the cmTarget header/type.
* cmGeneratorTarget: Move FindTargetToLink from cmTarget.Stephen Kelly2015-10-121-2/+2
|
* cmGeneratorTarget: Move GetUtilityItems from cmTarget.Stephen Kelly2015-10-121-0/+1
|
* cmComputeLinkDepends: Port result API to cmGeneratorTarget.Stephen Kelly2015-10-121-2/+2
|
* Merge topic 'use-generator-target'Brad King2015-10-121-2/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1c1c2a12 cmGeneratorTarget: Port ExpandLinkItems away from cmTarget. c66084f5 cmGeneratorTarget: Port GetImportLinkInterface away from cmTarget. 83c29e39 cmGeneratorTarget: Port ComputeLinkImplementationLibraries away from cmTarget. 19882554 cmGeneratorTarget: Port handleSystemIncludesDep away from cmTarget. c1f687b1 cmGeneratorTarget: Port GetLinkImplementationLibrariesInternal. a6e1f05c cmGeneratorTarget: Port ComputeLinkInterface away from cmTarget. 654002fe cmGeneratorTarget: Port ComputeLinkInterfaceLibraries away from cmTarget. 922c8901 cmGeneratorTarget: Port GetLinkInterface away from cmTarget. eaa5b9cb cmGeneratorTarget: Port cmTargetCollectLinkLanguages away from cmTarget. f539da12 cmGeneratorTarget: Port GetLinkInterfaceLibraries away from cmTarget. 1c5d70f9 cmGeneratorTarget: Port processILibs away from cmTarget. 064c2488 cmComputeLinkDepends: Port some API to cmGeneratorTarget. 3e428fdc cmGeneratorTarget: Move IsImportedSharedLibWithoutSOName from cmTarget. 110fd2fb cmGeneratorTarget: Move GetOutputTargetType from cmTarget. e7391699 cmGeneratorTarget: Move HasMacOSXRpathInstallNameDir from cmTarget. c5718217 cmGeneratorTarget: Move HaveInstallTreeRPATH from cmTarget. ...
| * cmComputeLinkDepends: Port some API to cmGeneratorTarget.Stephen Kelly2015-10-101-2/+1
| |
* | cmComputeLinkDepends: Remove unused typedef.Stephen Kelly2015-10-081-2/+0
|/
* cmTarget: Move link interface libraries struct out.Stephen Kelly2015-08-261-1/+1
|
* cmComputeLinkDepends: Port to cmGeneratorTarget.Stephen Kelly2015-08-051-2/+4
|
* cmComputeLinkDepends: Re-arrange data layout.Stephen Kelly2015-06-071-11/+7
| | | | Size goes from 648 to 632 bytes.
* cmComputeLinkDepends: Remove unused local generator.Stephen Kelly2015-05-031-2/+0
|
* cmComputeLinkDepends: Convert AddLinkEntries to a templateBrad King2014-07-071-2/+2
| | | | | 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-5/+5
| | | | | | | | | | | | | | | 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.
* cmComputeLinkInformation: Remove 'head' argumentBrad King2014-06-231-3/+1
| | | | | | It is only ever constructed with the current target as its own 'head'. Co-Author: Stephen Kelly <steveire@gmail.com>
* stringapi: Pass configuration names as stringsBen Boeckel2014-03-081-2/+3
|
* strings: Remove cmStdString referencesBen Boeckel2014-03-081-2/+2
| | | | | | | | | | | 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-1/+2
|
* cmComputeLinkDepends: Hold a const global generator.Stephen Kelly2014-01-121-1/+1
|
* Constify handling of link targets.Stephen Kelly2013-12-111-4/+4
|
* cmTarget: Make GetProperty() const.Stephen Kelly2013-10-311-3/+4
| | | | | | 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.
* Make linking APIs aware of 'head' targetStephen Kelly2013-01-081-1/+2
| | | | | | | | | | | 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.
* Tolerate cycles in shared library link interfaces (#12647)Brad King2012-01-131-0/+4
| | | | | | | | | | | | | 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.
* Split notion of node lists and edge listsBrad King2010-08-251-0/+1
|
* 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.
* Define 'multiplicity' for cyclic dependenciesBrad King2009-09-011-0/+1
| | | | | | | | | We create target property "LINK_INTERFACE_MULTIPLICITY" and a per-config version "LINK_INTERFACE_MULTIPLICITY_<CONFIG>". It sets the number of times a linker should scan through a mutually dependent group of static libraries. The largest value of this property on any target in the group is used. This will help projects link even for extreme cases of cyclic inter-target dependencies.
* ENH: Centralize default link interface computationBrad King2009-07-061-2/+1
| | | | | | When LINK_INTERFACE_LIBRARIES is not set we use the link implementation to implicitly define the link interface. These changes centralize the decision so that all linkable targets internally have a link interface.
* ENH: Move CMP0004 check into cmTargetBrad King2009-07-061-1/+0
| | | | | | This moves code implementing policy CMP0004 into cmTarget::CheckCMP0004. The implementation is slightly simpler and can be re-used outside of cmComputeLinkDepends.
* BUG: Lookup transitive link deps in depender scopeBrad King2009-04-061-3/+3
| | | | | | | The transitive link dependencies of a linked target must be followed in its own scope, not in the scope of the original target that depends on it. This is necessary since imported targets do not have global scope. See issue #8843.
* ENH: Allow a custom list of debug configurationsBrad King2008-09-041-0/+1
| | | | | | Create a DEBUG_CONFIGURATIONS global property as a way for projects to specify which configuration names are considered to be 'debug' configurations.
* COMP: Do not use private typedef from outside class.Brad King2008-08-271-1/+1
|
* ENH: New link line item ordering algorithmBrad King2008-08-271-5/+23
| | | | | | | | | This change introduces a new algorithm for link line construction. The order it computes always begins with the exact link line specified by the user. Dependencies of items specified by the user are tracked, and those that are not already satisified by the line are appended to it at the end with minimal repeats. This restores the behavior of CMake 2.4 and below while still fixing some of its bugs. See issue #7546.
* BUG: Do not infer dependencies of link flagsBrad King2008-08-271-2/+4
| | | | | | | In cmComputeLinkDepends link items that look like flags (starting in '-') should not be included in dependency inferral. They are not libraries and therefore have no dependencies. They should just be passed through to the final link line unchanged. See issue #7546.
* BUG: Avoid bogus dependency on executable targetsBrad King2008-08-061-0/+1
| | | | | | | | | | | | When an executable target within the project is named in target_link_libraries for another target, but the executable does not have the ENABLE_EXPORTS property set, then the executable cannot really be linked. This is probably a case where the user intends to link to a third-party library that happens to have the same name as an executable target in the project (or else will get an error at build time). We need to avoid making the other target depend on the executable target incorrectly, since the executable may actually want to link to that target and this is not a circular depenency.
* BUG: Preserve all non-targets on user link linesBrad King2008-07-301-5/+0
| | | | | | | | | | | | | | | | | | | | | In CMake 2.4 the generated link line for a target always preserved the originally specified libraries in their original order. Dependencies were satisfied by inserting extra libraries into the line, though it had some bugs. In CMake 2.6.0 we preserved only the items on the link line that are not known to be shared libraries. This reduced excess libraries on the link line. However, since we link to system libraries (such as /usr/lib/libm.so) by asking the linker to search (-lm), some linkers secretly replace the library with a static library in another implicit search directory (developers can override this by using an imported target to force linking by full path). When this happens the order still matters. To avoid this and other potential subtle issues this commit restores preservation of all non-target items and static library targets. This will create cases of unnecessary, duplicate shared libraries on the link line if the user specifies them, but at least it will work. In the future we can attempt a more advanced analysis to safely remove duplicate shared libraries from the link line.
* ENH: When preserving potentially static portions of original user link lines ↵Brad King2008-04-301-0/+5
| | | | recognize shared library names by their extension and skip them.
* BUG: Fix preservation of static libraries on original link lines.Brad King2008-04-231-0/+5
|
* BUG: Fix bug 6605 more completelyBrad King2008-03-311-0/+9
| | | | | | - CMake 2.4 added link directories for targets linked in the optimized configuration even when building debug - Old behavior for policy CMP0003 must account for this
* ENH: Add policy CMP_0004 to require library names to have no leading or ↵Brad King2008-03-131-0/+2
| | | | trailing whitespace. Replace previous check of CMAKE_BACKWARDS_COMPATIBILITY against version 2.4 with the policy.
* BUG: Update cmComputeLinkDepends to support leading/trailing whitespace ↵Brad King2008-02-131-0/+1
| | | | stripping off link items for compatibility.
* ENH: Improve link line generation for static library cycles.Brad King2008-02-071-6/+11
| | | | | | | | | - Move Tarjan algorithm from cmComputeTargetDepends into its own class cmComputeComponentGraph - Use cmComputeComponentGraph to identify the component DAG of link dependencies in cmComputeLinkDepends - Emit non-trivial component members more than once but always in a contiguous group on the link line
* ENH: Support linking to shared libs with dependent libsBrad King2008-01-311-3/+19
| | | | | | | | | - Split IMPORTED_LINK_LIBRARIES into two parts: IMPORTED_LINK_INTERFACE_LIBRARIES IMPORTED_LINK_DEPENDENT_LIBRARIES - Add CMAKE_DEPENDENT_SHARED_LIBRARY_MODE to select behavior - Set mode to LINK for Darwin (fixes universal binary problem) - Update ExportImport test to account for changes
* ENH: Updated exporting and importing of targets to support libraries and ↵Brad King2008-01-281-1/+4
| | | | | | | | | | | | | | | | | | configurations. - Created cmExportFileGenerator hierarchy to implement export file generation - Installed exports use per-config import files loaded by a central one. - Include soname of shared libraries in import information - Renamed PREFIX to NAMESPACE in INSTALL(EXPORT) and EXPORT() commands - Move addition of CMAKE_INSTALL_PREFIX to destinations to install generators - Import files compute the installation prefix relative to their location when loaded - Add mapping of importer configurations to importee configurations - Rename IMPORT targets to IMPORTED targets to distinguish from windows import libraries - Scope IMPORTED targets within directories to isolate them - Place all properties created by import files in the IMPORTED namespace - Document INSTALL(EXPORT) and EXPORT() commands. - Document IMPORTED signature of add_executable and add_library - Enable finding of imported targets in cmComputeLinkDepends
* ENH: Created cmComputeLinkDepends to compute link dependencies.Brad King2008-01-271-0/+106
- This will be useful for imported library dependencies - Replaces old cmTarget analyze-lib-depends stuff for linking - Formalizes graph construction and dump - Explicitly represents dependency inferral sets - Use BFS of initial dependencies to preserve order