summaryrefslogtreecommitdiffstats
path: root/Source/cmComputeLinkDepends.h
Commit message (Collapse)AuthorAgeFilesLines
* LINK_LIBRARY-genex: correct behavior for INTERFACE_LINK_LIBRARIES_DIRECTMarc Chevrier2023-11-291-1/+1
| | | | Fixes: #25416
* LinkItem: track `cmSourceFile` instances for external objectsBen Boeckel2023-11-231-0/+4
| | | | | The target may be required in order to provide Fortran modules, so track the source file so that the target may be looked up when needed.
* cmComputeLinkInformation: Track targets named by TARGET_OBJECTS sourcesBrad King2023-11-141-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit b6a5382217 (Ninja: depend on language module information files directly, 2023-02-10, v3.27.0-rc1~502^2), the return value of `cmCommonTargetGenerator::GetLinkedTargetDirectories` must account for linked object libraries because they may provide modules (#25112). These were added by commit b665966933 (cmComputeLinkInformation: track OBJECT library dependencies, 2023-07-22, v3.27.1~5^2). However, targets named by `$<TARGET_OBJECTS:...>` sources are also needed (#25365). The latter were added by commit 22da18b995 (Fortran: Restore support for TARGET_OBJECTS providing modules, 2023-10-27, v3.28.0-rc4~9^2) and commit 035302b7e3 (cmComputeLinkDepends: also copy the target from object link items, 2023-10-27, v3.28.0-rc4~9^2~2). However, their approach added link entries not actually specified by projects. It also incorrectly re-used `cmComputeLinkDepends::AddLinkObject` for object library targets when it is meant for their individual object files. These problems caused additional regressions (#25417). Revert the implementation parts of those commits and leave behind an assertion and comment to help avoid the mistake in the future. Instead, track targets named by `$<TARGET_OBJECTS:...>` sources with a dedicated member. Issue: #25112 Issue: #25365 Fixes: #25417 Co-authored-by: Ben Boeckel <ben.boeckel@kitware.com>
* Fortran: Restore support for TARGET_OBJECTS providing modulesBen Boeckel2023-10-301-0/+1
| | | | | | | | | | | | | Continue b665966933 (cmComputeLinkInformation: track OBJECT library dependencies, 2023-07-22) which added explicitly listed `OBJECT` libraries to the list of targets which the collator needs to consider. Now also consider targets which provide objects directly to the target via a `$<TARGET_OBJECT>` source lists. Also add tests which use target objects directly and through an `INTERFACE` library with target objects in its own sources. Fixes: #25365
* cmComputeComponentGraph: use `size_t` for component indicesBen Boeckel2023-01-311-29/+30
| | | | This avoids using casts everywhere when dealing with the sizes.
* cmComputeComponentGraph: use a name for "invalid component"Ben Boeckel2023-01-311-2/+3
| | | | This is to prepare for making the graph use `size_t`.
* Genex-LINK_GROUP: Add possibility to group libraries at link stepMarc Chevrier2022-02-281-2/+14
| | | | Fixes: #23121
* cmComputeDepends::LinkEntry: introduce enum to specify item typeMarc Chevrier2022-02-251-3/+9
|
* $<LINK_LIBRARY>: Add LINK_LIBRARY_OVERRIDE target propertyMarc Chevrier2022-02-081-1/+7
| | | | | | To enable the management of incompatible $<LINK_LIBRARY> declarations, add LINK_LIBRARY_OVERRIDE and LINK_LIBRARY_OVERRIDE_<LIBRARY> target properties.
* Genex: Add $<LINK_LIBRARY:...>Marc Chevrier2022-02-071-4/+9
| | | | | | | | This generator expression offers the capability, for the link step, to decorate libraries with prefix/suffix flags and/or adding any specific flag for each library. Fixes: #22812, #18751, #20078, #22703
* cmComputeLinkInformation: use cmComputeLinkDepends::LinkEntryMarc Chevrier2022-02-061-0/+8
| | | | | | In preparation of support of genex $<LINK_LIBRARY:...>, propagate cmComputeLinkDepends::LinkEntry instances to ensure to have, when needed, all attributes attached to the link item.
* target_link_libraries: Place $<TARGET_OBJECTS> before librariesBrad King2021-05-291-0/+5
| | | | | | | | | Linkers always use object files explicitly specified on the command line regardless of where they appear. Move them to the front of the list of linked libraries in so that symbols required by the object files can be resolved by any library. Issue: #22149
* OpenWatcom: Add infrastructure to link to object filesBrad King2021-05-291-0/+1
|
* Modernize: Use #pragma once in all header filesKitware Robot2020-09-031-4/+1
| | | | | | | | | | | | | | | | #pragma once is a widely supported compiler pragma, even though it is not part of the C++ standard. Many of the issues keeping #pragma once from being standardized (distributed filesystems, build farms, hard links, etc.) do not apply to CMake - it is easy to build CMake on a single machine. CMake also does not install any header files which can be consumed by other projects (though cmCPluginAPI.h has been deliberately omitted from this conversion in case anyone is still using it.) Finally, #pragma once has been required to build CMake since at least August 2017 (7f29bbe6 enabled server mode unconditionally, which had been using #pragma once since September 2016 (b13d3e0d)). The fact that we now require C++11 filters out old compilers, and it is unlikely that there is a compiler which supports C++11 but does not support #pragma once.
* Merge branch 'backport-3.16-link-line-backtrace'Brad King2020-02-101-1/+2
|\
| * Propagate backtraces from LINK_LIBRARIES through to link line itemsBrad King2020-02-101-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Since commit d4d0dd0f6a (cmLinkLineComputer: Add ComputeLinkLibs overload with backtraces, 2019-09-13, v3.16.0-rc1~87^2~4), backtraces have been collected by `ComputeLinkLibs` by looking back through the link implementation libraries for one matching the text of the link line item. This is slow in projects with long link lines. Instead, teach `cmComputeLinkDepends` and `cmComputeLinkInformation` to carry backtrace information explicitly along with the text of each item. Fixes: #20322
* | clang-format: fix erroneous handling of header <queue>Marc Chevrier2020-01-061-2/+1
|/ | | | The rule Regex: '^<' was not applied to this header because a more specific one applies: Regex: '^(<|")Qt?[A-Z]' used for Qt headers (rules are not case-sensitive). So adding a specific rule for this header before the Qt rule is required.
* Revise include order using clang-format-6.0Kitware Robot2019-10-011-5/+6
| | | | | Run the `clang-format.bash` script to update our C and C++ code to a new include order `.clang-format`. Use `clang-format` version 6.0.
* cmComputeLinkDepends: remove manual memory deallocationTushar Maheshwari2019-09-181-1/+2
| | | | | - Replace owning raw `DependSetList` pointer with direct object. - Use an extra `bool Initialized` flag to imitate `nullptr` semantics.
* clang-tidy: Replace typedef with usingRegina Pfeifer2019-09-031-4/+4
|
* IWYU: Fix handling of <memory> standard headerBrad King2019-07-101-0/+1
| | | | | | | | An old workaround for `std::allocator_traits<>::value_type` lints from IWYU on `std::vector<>` usage breaks IWYU's handling of `<memory>`. Convert the workaround to use the same approach we already use for a workaround of `std::__decay_and_strip<>::::__type` lints. Then update the `<memory>` inclusions to follow the now-correct IWYU lints.
* modermize: replace some raw pointers w/ `unique_ptr`Alex Turbov2019-06-241-1/+1
|
* Delete some default constructors and assignment operatorsAlbert Astals Cid2019-02-151-0/+3
| | | | | | They are unused, but if someone used them they would lead to problems since they would copy the internal raw pointers and the destructor would cause double delete
* cleanup: Prefer compiler provided special member functionsRegina Pfeifer2019-01-251-2/+0
|
* clang-tidy: Use `= default`Regina Pfeifer2019-01-251-8/+2
| | | | | | Suppress some cases in `Source/cmGeneratorExpressionNode.cxx` and `Source/cmUVHandlePtr.h` where a few older compilers require a user-defined default constructor (with `{}`).
* clang-tidy: Use default member initializationRegina Pfeifer2018-12-151-9/+4
|
* clang-tidy: Remove redundant member initializationsRegina Pfeifer2018-12-151-2/+1
|
* Fix dependency propagation through same-name imported targetsBrad King2018-09-071-3/+3
| | | | | | | | | | If two imported targets in different directories have the same name we should still be able to propagate transitive link dependencies from both. Fix the target and link dependency analyzers to de-duplicate targets using target pointers rather than target names since the pointers will not be duplicated even if the names are. Issue: #18345
* cmLinkItem: Convert to a "sum type" over a string and target pointerBrad King2018-09-071-2/+1
| | | | | | | | | Avoid exposing the item name implicitly as std::string. When the item is a target, avoid storing a second copy of its name. Most link item construction is paired with calls to `FindTargetToLink` to get the possible target pointer. Rename these methods to `ResolveLinkItem` and refactor them to construct the entire item.
* Use C++11 nullptrDaniel Pfeifer2017-08-241-1/+1
|
* Pass large types by const&, small types by valueDaniel Pfeifer2017-06-031-1/+1
|
* Use quotes for non-system includesDaniel Pfeifer2017-04-111-1/+1
| | | | | | | | | | | | | Automate with: git grep -l '#include <cm_' -- Source \ | xargs sed -i 's/#include <\(cm_.*\)>/#include "\1"/g' git grep -l '#include <cmsys/' -- Source \ | xargs sed -i 's/#include <\(cmsys\/.*\)>/#include "\1"/g' git grep -l '#include <cm[A-Z]' -- Source \ | xargs sed -i 's/#include <\(cm[A-Z].*\)>/#include "\1"/g'
* Simplify CMake per-source license noticesBrad King2016-09-271-11/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Per-source copyright/license notice headers that spell out copyright holder names and years are hard to maintain and often out-of-date or plain wrong. Precise contributor information is already maintained automatically by the version control tool. Ultimately it is the receiver of a file who is responsible for determining its licensing status, and per-source notices are merely a convenience. Therefore it is simpler and more accurate for each source to have a generic notice of the license name and references to more detailed information on copyright holders and full license terms. Our `Copyright.txt` file now contains a list of Contributors whose names appeared source-level copyright notices. It also references version control history for more precise information. Therefore we no longer need to spell out the list of Contributors in each source file notice. Replace CMake per-source copyright/license notice headers with a short description of the license and links to `Copyright.txt` and online information available from "https://cmake.org/licensing". The online URL also handles cases of modules being copied out of our source into other projects, so we can drop our notices about replacing links with full license text. Run the `Utilities/Scripts/filter-notices.bash` script to perform the majority of the replacements mechanically. Manually fix up shebang lines and trailing newlines in a few files. Manually update the notices in a few files that the script does not handle.
* fix a batch of include-what-you-use violationsDaniel Pfeifer2016-08-231-2/+7
|
* 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
|