summaryrefslogtreecommitdiffstats
path: root/Source
Commit message (Collapse)AuthorAgeFilesLines
* Merge topic 'cmFileCopier-error-loss' into release-3.28Brad King2023-12-057-59/+77
|\ | | | | | | | | | | | | | | | | | | a820877d03 errors: avoid constructing a stream before getting the last error 5cf7018af6 cmFileCopier: remember error statuses and get their strings 0639a32d3a cmFileTimes: return status codes from APIs Acked-by: Kitware Robot <kwrobot@kitware.com> Tested-by: buildbot <buildbot@kitware.com> Merge-request: !9023
| * errors: avoid constructing a stream before getting the last errorBen Boeckel2023-12-025-28/+20
| | | | | | | | | | Constructing a stream may involve operations that change the global error state. Avoid the streams by using `cmStrCat` instead.
| * cmFileCopier: remember error statuses and get their stringsBen Boeckel2023-12-021-14/+23
| | | | | | | | | | | | | | | | The last error may have changed between the original call and the `GetLastSystemError()` call. Remember the status explicitly and ask it for its error string. Reported on Discourse: https://discourse.cmake.org/t/9539
| * cmFileTimes: return status codes from APIsBen Boeckel2023-12-022-17/+34
| | | | | | | | | | This avoids accidentally overwriting the global error state before fetching the intended error code.
* | cmFileLockResult: Fix inclusion of windows.h when cross-compilingBrad King2023-12-041-1/+1
| | | | | | | | | | | | | | | | | | In commit 64821d8a26 (cmFileLockResult: Remove expensive windows.h include, 2023-06-16, v3.28.0-rc1~446^2~13) we accidentally capitalized the name of the header. This matters when cross-compiling from a host with a case-sensitive filesystem. Fixes: #25474
* | CMake 3.28.0-rc6v3.28.0-rc6Brad King2023-11-301-1/+1
| |
* | Merge topic 'ccmake-install-rds-crash' into release-3.28Brad King2023-11-301-0/+2
|\ \ | | | | | | | | | | | | | | | | | | d01120a47a cmGlobalGenerator: clear RuntimeDependencySet members at configure Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !9013
| * | cmGlobalGenerator: clear RuntimeDependencySet members at configureBen Boeckel2023-11-291-0/+2
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit f2617cf8e6 (Source: Add cmInstallRuntimeDependencySet, 2021-05-19) introduced via !6186 to 3.21 added storage to the global generator for runtime dependency sets. However, this was not cleared at the start of configure in the `ClearGeneratorMembers()` method. When using `ccmake` to configure (and, presumably `cmake-gui` too), projects using `install(TARGETS … RUNTIME_DEPENDENCY_SET)` would use dependency set tracking instances from previous configure runs that held references to targets free'd with the `cmMakefile` instance that held them. Clear the dependency sets at the beginning of configure so that they are not remembered and trigger via use-after-free bugs when used. Fixes: #25446
* | Merge topic 'cxxmodules-diagnostics' into release-3.28Brad King2023-11-291-7/+12
|\ \ | | | | | | | | | | | | | | | | | | | | | cbd549b09e cxxmodules: Add more suggestions to no-modules-support diagnostics Acked-by: Kitware Robot <kwrobot@kitware.com> Tested-by: buildbot <buildbot@kitware.com> Merge-request: !9011
| * | cxxmodules: Add more suggestions to no-modules-support diagnosticsBrad King2023-11-281-7/+12
| |/ | | | | | | | | | | Tell users what generators *do* support C++ modules. Report the current generator to make clear it is not one of those supporting modules. Also clarify the purpose of the existing documentation references.
* | Xcode: Fix embed resources prop namehalx992023-11-281-3/+2
|/ | | | | | | Fix commit e40d2cb3af (Xcode: Add embed resources support, 2023-07-31, v3.28.0-rc1~281^2). The implementation should not name the `_PATH` suffix explicitly. That variant is automatically handled by `cmGlobalXCodeGenerator::AddEmbeddedObjects`.
* Makefiles: provide, but do not consume, "forward linked" target dirsBen Boeckel2023-11-232-0/+17
| | | | | | | Makefiles do not have a per-object sense of where they come from, so forwarding any module information here would end up with incorrect module file path construction by consuming targets. Leave a TODO item in its place.
* cmCommonTargetGenerator: use modules from linked object-referenced targetsBen Boeckel2023-11-232-1/+15
| | | | | | | | Fortran modules provided by objects added as linked items via `$<TARGET_OBJECTS>` should also be considered as "linked targets" for collation purposes. As C++ modules have their own visibility rules through their `FILE_SET` feature, do not expose these for C++ module collation.
* LinkItem: track `cmSourceFile` instances for external objectsBen Boeckel2023-11-236-13/+30
| | | | | 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.
* Ninja: support "forwarding" modules from other targetsBen Boeckel2023-11-233-1/+68
| | | | | | | | | | | | | When a target uses objects from another target which provides modules as sources, the modules provided by the referenced target must also be treated as if they were provided by the referencing target. Add the concept of "forwarding" modules so that consumers can use modules created by these sources as well. Note that this is only sensible for Fortran where module usages are implicit as far as CMake's visibility model is concerned. C++ modules have their own concept of visibility which does not require or support such `$<TARGET_OBJECTS>` reuse in this way.
* cmCommonTargetGenerator: return forward linked target dirs tooBen Boeckel2023-11-214-38/+62
| | | | | This will be used for module forwarding in order to support `$<TARGET_OBJECTS>` usage in source and link libraries calls.
* cmLocalUnixMakefileGenerator3: handle object-referencing Fortran modulesBen Boeckel2023-11-211-0/+11
| | | | | | Targets only using Fortran modules via `$<TARGET_OBJECTS>` also need a collation step to be performed. Check for this case and trigger the depends rule to be used.
* cmNinjaTargetGenerator: handle object-referencing Fortran modulesBen Boeckel2023-11-211-0/+9
| | | | | | Targets only using Fortran modules via `$<TARGET_OBJECTS>` also need a collation step to be performed. Check for this case and trigger the collation rule to be added and used.
* cmGeneratorTarget: also check included objects for Fortran modulesBen Boeckel2023-11-211-9/+37
| | | | | Fortran modules provided by objects in `$<TARGET_OBJECTS>` should also count as "has Fortran modules" for the target referencing the objects.
* cmCommonTargetGenerator: use modules from object-referenced targetsBen Boeckel2023-11-211-0/+8
| | | | | | | | Fortran modules provided by objects added as sources via `$<TARGET_OBJECTS>` should also be considered as "linked targets" for collation purposes. As C++ modules have their own visibility rules through their `FILE_SET` feature, do not expose these for C++ module collation.
* cmGeneratorTarget: add a query for targets with objects in the source listBen Boeckel2023-11-212-9/+23
| | | | | | This will be eventually be used to inform the collator of this information so that Fortran modules provided by the resulting objects can also be used as intended.
* cmGeneratorTarget: use pointers to `const` generator targets for languagesBen Boeckel2023-11-211-2/+2
|
* cmGeneratorTarget: track object libraries using a `set`Ben Boeckel2023-11-211-10/+4
| | | | | | This avoids having to do manual "is already present" checks. The order the targets are processed does not need to be preserved because the resulting `languages` result is already a `set`.
* Merge topic 'fileapi-file-sets-base-dirs-relative' into release-3.28Brad King2023-11-201-1/+1
|\ | | | | | | | | | | | | | | | | a3a85524cd fileapi: Fix file sets' base directories relative to top source Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Reviewed-by: Ben Boeckel <ben.boeckel@kitware.com> Merge-request: !8977
| * fileapi: Fix file sets' base directories relative to top sourceKyle Edwards2023-11-171-1/+1
| | | | | | | | | | | | | | | | This field was added by commit b3e9fb67bb (file-api: support exporting file set information, 2022-11-03, v3.26.0-rc1~389^2) but the relative path convention used elsewhere was accidentally left out. Fixes: #25422
| * ctest: Restore support for http redirects during Submit stepZack Galbreath2023-10-121-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After CDash PR 1519 introduced HTTP status codes greater than 200 for various error cases, CMake commit b7c871f745 (ctest: Update ctest_submit for CDash behavior change, 2023-07-24, v3.27.1~3^2) modified CTest's submit handler to check the status returned by CDash and throw an error when this status is not equal to 200. That change had the unintended side effect of causing CTest submissions to fail when uploading results to a URL that returns a redirect status code (3xx). Fix this by configuring cURL to follow the redirect. The status cURL reports to CTest is now 200 instead of 3xx when CDash is located behind a redirect. Fixes: #25159
* | Merge topic 'custom-command-ninja-deps' into release-3.28Brad King2023-11-201-2/+2
|\ \ | | | | | | | | | | | | | | | | | | 3c8d1eef72 Ninja: depfile: keep rules without dependencies Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !8984
| * | Ninja: depfile: keep rules without dependenciesMarc Chevrier2023-11-201-2/+2
| | | | | | | | | | | | | | | | | | | | | To avoid repeated executions of custom command actions, depfile file with rules without dependencies must be preserved. Fixes: #25428
| * | CMake 3.27.8v3.27.8Brad King2023-11-151-1/+1
| | |
* | | codespell: Fix typosBrad King2023-11-179-16/+16
| | |
* | | codespell: Match valgrind output without repeating a spelling errorBrad King2023-11-171-4/+4
| | |
* | | CMake 3.28.0-rc5v3.28.0-rc5Brad King2023-11-151-1/+1
| | |
* | | Merge branch 'backport-target-objects' into target-objectsBrad King2023-11-145-23/+46
|\ \ \ | |/ /
| * | cmComputeLinkInformation: Track targets named by TARGET_OBJECTS sourcesBrad King2023-11-145-21/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | cmCommonTargetGenerator: Factor out GetLinkedTargetDirectories loop bodyBrad King2023-11-141-9/+8
| | | | | | | | | | | | Re-use the body in multiple loops instead of allocating to combine them.
* | | cmCommonTargetGenerator: Drop unused local variableBrad King2023-11-141-1/+0
| | |
* | | 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.
* | | cmGeneratorExpressionNode: Fix short-circuit logicMartin Duffy2023-11-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Fix logic added by commit 634079b86d (cmGeneratorExpressionEvaluator: Short-circuit boolean operators, 2023-09-11, v3.28.0-rc1~47^2) and add missing test cases. Fixes: #25412
* | | Merge topic 'cxx23' into release-3.28Brad King2023-11-084-11/+14
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a0fabc4769 cmGlobalGeneratorFactory: Provide complete cmGlobalGenerator to deleter 85627a93c9 cmCTestBuildCommand: Avoid requiring complete cmGlobalGenerator type publicly 641c02a3ce cmList: Avoid using operator-> on input iterator e4483b8871 Tests: Avoid compiling call to dap::optional<dap::string>(nullptr) Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Acked-by: scivision <michael@scivision.dev> Merge-request: !8950
| * | | cmGlobalGeneratorFactory: Provide complete cmGlobalGenerator to deleterBrad King2023-11-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | The libc++ `unique_ptr` implementation requires this since C++23. Fixes: #25388
| * | | cmCTestBuildCommand: Avoid requiring complete cmGlobalGenerator type publiclyBrad King2023-11-072-9/+12
| | | |
| * | | cmList: Avoid using operator-> on input iteratorBrad King2023-11-071-1/+1
| | | | | | | | | | | | | | | | As of C++23, some standard library iterator types deprecate it.
* | | | Merge topic 'static-library-link-xcframework' into release-3.28Brad King2023-11-071-21/+72
|\ \ \ \ | |/ / / |/| | | | | | | | | | | | | | | | | | | 7d19246138 Xcode: Fix linking against .xcframework from static libraries Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !8949
| * | | Xcode: Fix linking against .xcframework from static librariesKyle Edwards2023-11-061-21/+72
| | | | | | | | | | | | | | | | Issue: #21752
* | | | CMake 3.28.0-rc4v3.28.0-rc4Brad King2023-11-061-1/+1
|/ / /
* | | cmSystemTools::RunSingleCommand(): Pass stdin to child processKyle Edwards2023-11-021-1/+3
| | | | | | | | | | | | Fixes: #25383
* | | Merge topic 'cxxmodules-cmp0155-graceful-fallback-without-scanner' into ↵Brad King2023-11-016-13/+33
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | release-3.28 1f507580a1 cmGlobalGenerator: give context about module queries 889aa0354a CMP0155: ignore scanning for sources if no scanner is available Acked-by: Kitware Robot <kwrobot@kitware.com> Tested-by: buildbot <buildbot@kitware.com> Merge-request: !8925
| * | | cmGlobalGenerator: give context about module queriesBen Boeckel2023-11-015-8/+22
| | | | | | | | | | | | | | | | | | | | | | | | Some queries are merely investigating support in order to change behavior. Let the method know so that any internal errors can be skipped over.
| * | | CMP0155: ignore scanning for sources if no scanner is availableBen Boeckel2023-11-012-6/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows for a more graceful transition for projects using C++20 without scanner support (e.g., Clang 15 or GCC 13). While newer compilers will (needlessly) scan, it allows C++20-using projects to use older compilers without having to set `CMAKE_CXX_SCAN_FOR_MODULES` to support newer CMake minimum versions. Fixes: #25357
* | | | ctest: Allow colored output on Windows if CLICOLOR_FORCE is set to 1Cristian Adam2023-11-011-10/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Windows 10 supports ANSI colors since v1511. For earlier versions of Windows installing ANSICON will enable ANSI colors in cmd.exe. For those setups where the environment is set up with CLICOLOR_FORCE set to 1 ctest should honor the setting and emit colored ANSI output.