summaryrefslogtreecommitdiffstats
path: root/Source/cmComputeLinkInformation.cxx
Commit message (Collapse)AuthorAgeFilesLines
* cxxmodules: compute link information for C++ module-consuming targetsMatheus Izvekov2024-01-141-1/+2
| | | | | | | | | Compute link information for all C++ targets which support modules instead of just those which may provide modules, as they may import modules as well. This captures `OBJECT` libraries using modules which otherwise do not have link steps. Fixes: #25592
* Source: Restore compilation on OpenBSDRafael Sadowski2024-01-051-2/+2
| | | | We cannot use `OpenBSD` as a name, it is defined in `sys/param.h`.
* cmComputeLinkInformation: Restore soname lookup for non-imported targetsBrad King2023-12-051-11/+12
| | | | | | | | | In commit 7351d590ee (cmTarget: Add a way to represent imported shared library stubs, 2023-07-17, v3.28.0-rc1~344^2) we accidentally stopped passing the SONAME of a non-imported SHARED library to our runtime search path ordering logic. Unfortunately I have not found a way to add a test case for this, but it at least shouldn't regress existing tests or those added by that commit.
* LinkItem: track `cmSourceFile` instances for external objectsBen Boeckel2023-11-231-13/+13
| | | | | 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.
* codespell: Fix typosBrad King2023-11-171-1/+1
|
* Merge branch 'backport-target-objects' into target-objectsBrad King2023-11-141-0/+31
|\
| * cmComputeLinkInformation: Track targets named by TARGET_OBJECTS sourcesBrad King2023-11-141-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | cmComputeLinkInformation: Simplify recording OBJECT libraries as link itemsBrad King2023-11-141-1/+1
| | | | | | | | | | | | Simplify commit 2c7acd34e2 (cmComputeLinkInformation: add `OBJECT` libraries as link items, 2023-07-24, v3.28.0-rc1~279^2) using the existing local variables.
* | Merge topic 'modules-depends-via-target-objects' into release-3.28Brad King2023-10-311-1/+1
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | 22da18b995 Fortran: Restore support for TARGET_OBJECTS providing modules 64d9240564 cmComputeLinkInformation: skip over linking to items for object purposes 035302b7e3 cmComputeLinkDepends: also copy the target from object link items 861876b936 Tests/ObjectLibrary: fix comment Acked-by: Kitware Robot <kwrobot@kitware.com> Tested-by: buildbot <buildbot@kitware.com> Acked-by: scivision <michael@scivision.dev> Merge-request: !8923
| * cmComputeLinkInformation: skip over linking to items for object purposesBen Boeckel2023-10-271-1/+1
| | | | | | | | | | If a name is only found because it is a link entry of kind `Object`, do not add anything to the link line.
* | Merge topic 'fortran-in-custom-targets'Brad King2023-09-201-2/+3
|\ \ | |/ | | | | | | | | | | | | | | | | | | d870a47e23 Tests/FortranModules: add a test for iface Fortran sources e3d511fb9c Tests/FortranModules: also test INTERFACE targets with Fortran sources 978b68d3bb add_custom_target: Fix regression with Fortran sources 619aca80ae Tests/FortranModules: add a test case for #25223 45513c1a69 Tests/FortranModules: move issue 25112 fix from FortranOnly Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !8814
| * add_custom_target: Fix regression with Fortran sourcesBen Boeckel2023-09-201-2/+3
| | | | | | | | | | | | | | | | | | | | Since commit 74b1d6caf3 (cmComputeLinkInformation: compute link info for module-using targets, 2023-09-05, v3.27.5~7^2) we accidentally try to compute link information for custom targets if they have Fortran sources. For module dependencies, we only need to consider target types that can compile. Fixes: #25252
* | Merge branch 'fortran-object-libraries-release' into fortran-object-librariesBen Boeckel2023-09-051-2/+5
|\ \ | |/ | | | | | | | | * fortran-object-libraries-release: cmComputeLinkInformation: compute link info for module-using targets cmGeneratorTarget: support config-independent Fortran source queries
| * cmComputeLinkInformation: compute link info for module-using targetsBen Boeckel2023-09-051-2/+5
| | | | | | | | | | | | | | | | Targets which contain C++ module or Fortran sources need to participate in link information unconditionally regardless of whether they actually have link artifacts or not. Fixes: #25223
* | cmComputeLinkInformation: add `OBJECT` libraries as link itemsBen Boeckel2023-08-011-12/+1
| | | | | | | | | | | | This completes the transition started in commit b665966933 (cmComputeLinkInformation: track OBJECT library dependencies, 2023-07-22).
* | macOS: Add support for linking against .xcframework foldersKyle Edwards2023-07-261-0/+88
| | | | | | | | Issue: #21752
* | Merge topic 'dyndep-module-info-objlib-dependency'Brad King2023-07-241-2/+12
|\ \ | |/ | | | | | | | | | | | | | | | | b665966933 cmComputeLinkInformation: track OBJECT library dependencies a99b87a628 Tests/RunCMake/CXXModules: add a test for issue #25112 2870a67540 Tests/FortranOnly: add a test case for issue #25112 Acked-by: Kitware Robot <kwrobot@kitware.com> Tested-by: buildbot <buildbot@kitware.com> Merge-request: !8645
| * cmComputeLinkInformation: track OBJECT library dependenciesBen Boeckel2023-07-221-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In commit b6a5382217 (Ninja: depend on language module information files directly, 2023-02-10), introduced via !8197, language-specific module information files (`CMakeFiles/<target>.dir/<lang>Modules.json`) files were added as real dependencies to the dyndep collation steps. Previously, the behavior was to inform the collator of all possible targets and search for the files manually ignoring those which did not exist with ordering enforced by depending on the linker output of all dependent targets. This behavior could lead to stale information being used (e.g., if a target stops providing any targets) and also did not reliably build everything needed on rebuilds. Afterwards, the internal computation changed the dependency from all possible targets to an exact set of "these targets might have modules" query, however one that did not include `OBJECT` libraries since do not have `LinkEntry` items internally (their objects are instead treated as source files). As a stopgap measure, track `OBJECT` libraries in a separate list and query them explicitly when gathering targets which may have interesting information. Future work can add `LinkEntry` items to represent these targets once all `LinkEntry` consumers have been audited to make sure they are not surprised by any `OBJECT` library entries. Fixes: #25112
* | cmTarget: Add a way to represent imported shared library stubsRobert Maynard2023-07-181-7/+11
| | | | | | | | | | | | | | | | Shared library stubs can be used for linking, but not at runtime. Their role is similar to import libraries on Windows, so represent their location with the `IMPORTED_IMPLIB` target property. Fixes: #24940
* | macOS: Allow IMPORTED_LOCATION to be a framework folderKyle Edwards2023-06-231-6/+25
|/ | | | Issue: #24946
* Apple text-based stubs: ensure runpath is correctly definedMarc Chevrier2023-06-041-2/+17
| | | | This is a complement to !8204.
* CMake code rely on cmList class for CMake lists management (part. 2)Marc Chevrier2023-04-291-18/+14
|
* CMake code rely on cmList class for CMake lists management (part. 1)Marc Chevrier2023-04-241-15/+16
|
* Xcode: Fix missing Frameworks search pathsMarc Chevrier2023-03-061-13/+19
| | | | Fixes: #24541
* Enhance support functionsMarc Chevrier2023-02-281-2/+2
| | | | | * Avoid duplicate definiitions for IsExecutableWithExports, etc... * Add helper IsApple()
* cmComputeLinkInformation: use characters where possibleBen Boeckel2023-02-061-8/+8
|
* cmComputeLinkInformation: combine string literals where possibleBen Boeckel2023-02-061-23/+21
|
* cmComputeLinkInformation: use `cmStrCat` where appropriateBen Boeckel2023-02-031-12/+14
|
* Revise C++ coding style using clang-format-15Kitware Robot2023-01-181-1/+1
| | | | | | | | | | | | | | Run the `clang-format.bash` script to update all our C and C++ code to a new style defined by `.clang-format`. Use `clang-format` version 15. * 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. Fixes: #24315
* cmValue: Use operator* explicitly to convert to std::string; avoid extra callVitaly Stakhovsky2023-01-161-5/+5
|
* Code comments: Fix trivial typosCraig Scott2022-12-171-1/+1
|
* Genex LINK_LIBRARY: Add support for framework with postfixMarc Chevrier2022-09-211-26/+22
|
* Apple: Fix regression when linking a framework with postfixMarc Chevrier2022-09-141-7/+5
| | | | | | | Fix a regression caused by commit 40178f3c90 (cmGlobalGenerator: Add helper to split framework path, 2022-02-10, v3.24.0-rc1~661^2~1). Fixes: #23961
* genex-LINK_LIBRARY: ensure correct generation inside LINK_GROUP genexMarc Chevrier2022-07-051-0/+11
| | | | | | | | | | | | | | | | This fix ensures the following pattern is correctly handled: $<LINK_GROUP:group_feat,$<LINK_LIBRARY:lib_feat,mylib>> With: CMAKE_LINK_GROUP_USING_group_feat = "—START_GROUP" "—END_GROUP" CMAKE_LINK_LIBRARY_USING_lib_feat = "—PREFIX" "—LINK <LIBRARY>" "—SUFFIX" Before the fix, we get the following generation: —START_GROUP —PREFIX —LINK /path/to/mylib —END_GROUP —SUFFIX —END_GROUP and —SUFFIX are in the wrong order After the fix, we get the correct order: —START_GROUP —PREFIX —LINK /path/to/mylib —SUFFIX —END_GROUP
* Ensure targets which are frameworks can be used freelyMarc Chevrier2022-03-291-4/+10
| | | | | | | Ensure flag -F/path/to/framework is specified during compilation step of consumers of the framework. Fixes: #23336
* genex-LINK_(LIBRARY|GROUP) features: update variables behaviorMarc Chevrier2022-03-251-2/+6
| | | | | | | | Variable CMAKE_LINK_(LIBRARY|GROUP)_USING_<FEATURE>_SUPPORTED is evaluated only if CMAKE_<LANG>_LINK_(LIBRARY|GROUP)_USING_<FEATURE>_SUPPORTED is not defined. This new behavior enable to activate a feature globally on a platform and to disable it for some compilers and languages.
* Genex-LINK_GROUP: Add possibility to group libraries at link stepMarc Chevrier2022-02-281-83/+201
| | | | Fixes: #23121
* cmComputeDepends::LinkEntry: introduce enum to specify item typeMarc Chevrier2022-02-251-2/+4
|
* genex-LINK_LIBRARY: rename configuration variablesMarc Chevrier2022-02-161-2/+2
| | | | | | To be more consistent between genex and variables as well as the forecomming LINK_GROUP genex, rename variable *_LINK_USING_<FEATURE>* in *_LINK_LIBRARY_USING_<FEATURE>*
* GenEx/LINK_LIBRARY: Add features for framework support on AppleMarc Chevrier2022-02-151-22/+65
|
* cmGlobalGenerator: Add helper to split framework pathMarc Chevrier2022-02-131-6/+5
| | | | | cmComputeLinkInformation and cmGlobalXCodeGenerator now rely on this method to handle framework paths.
* $<LINK_LIBRARY>: Add LINK_LIBRARY_OVERRIDE target propertyMarc Chevrier2022-02-081-6/+11
| | | | | | 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-25/+362
| | | | | | | | 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-44/+67
| | | | | | 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.
* cmComputeLinkInformation: Add context to warning about linking a directoryBrad King2021-10-271-8/+9
|
* Source: Fix clang -Wimplicit-fallthrough warningsSean McBride2021-09-281-1/+5
|
* Rename cmProp in cmValueMarc Chevrier2021-09-211-18/+19
|
* Refactor: reduce cmToCStr usageMarc Chevrier2021-08-191-5/+2
|
* HIP: Add language to CMakeRobert Maynard2021-06-071-2/+2
|
* OpenWatcom: Add infrastructure to link to object filesBrad King2021-05-291-8/+19
|