summaryrefslogtreecommitdiffstats
path: root/Tests
Commit message (Collapse)AuthorAgeFilesLines
* cmCxxModuleMapper: Fix transitive requirements computationnamniav2023-12-0535-1/+384
| | | | | | | | | | | | | | | | | | | | Previously CMake may generate incomplete transitive requirements in CMakeFiles/<target>.dir/CXXModules.json and therefore in module mapper for compiler, when source files were listed in CMakeList.txt in a certain order. This commit fixes the problem by correctly tracking unfinished transitive requirements computation of module units. There have been a simple circular test case whose circular dependency was reported by build system. Now with this correct implementation it's reported by CMake generating module mappers. Add two test cases for transitive requirements computation, one with adding source files in hardcoded order, and the other in randomized order. Fixes: #25465
* Tests/CXXModules: add a test which scans a PCH-using sourceBen Boeckel2023-12-044-0/+24
| | | | This tests that PCH usage works with scanning logic.
* Tests: Add case to cover execute_process support for no extension on WindowsKyle Edwards2023-11-307-0/+57
| | | | Issue: #25450
* Merge topic 'cxxmodules-diagnostics' into release-3.28Brad King2023-11-295-14/+49
|\ | | | | | | | | | | | | | | 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-285-14/+49
| | | | | | | | | | | | 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-1/+1
|/ | | | | | | 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`.
* Merge topic 'fortran-objects-as-sources-fix' into release-3.28Brad King2023-11-2723-0/+138
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | beb1393f8f Merge branch 'revert-exact-collation-depends-3.27' into fortran-objects-as-sources-fix a033dce326 Makefiles: provide, but do not consume, "forward linked" target dirs 7cd0adab1b cmCommonTargetGenerator: use modules from linked object-referenced targets 1175f1c874 LinkItem: track `cmSourceFile` instances for external objects d2fa56772f Ninja: support "forwarding" modules from other targets ec1e589bec Ninja: Revert exact collation dependencies for 3.27 06df59b930 cmCommonTargetGenerator: return forward linked target dirs too f8729ab366 cmLocalUnixMakefileGenerator3: handle object-referencing Fortran modules ... Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !8989
| * Ninja: support "forwarding" modules from other targetsBen Boeckel2023-11-236-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * Merge branch 'revert-exact-collation-depends-3.27' (early part) into ↵Ben Boeckel2023-11-2117-0/+132
| |\ | | | | | | | | | | | | | | | | | | | | | fortran-objects-as-sources-fix * 'revert-exact-collation-depends-3.27' (early part): Tests/FortranModules: add test for TARGET_OBJECTS-as-linked-items module usage Tests/FortranModules: add test for TARGET_OBJECTS-as-sources module usage
| | * Tests/FortranModules: add test for TARGET_OBJECTS-as-linked-items module usageBen Boeckel2023-11-2110-0/+69
| | | | | | | | | | | | | | | | | | Test module usage across a `$<TARGET_OBJECTS>`-as-linked-items use case. See: #25425
| | * Tests/FortranModules: add test for TARGET_OBJECTS-as-sources module usageBen Boeckel2023-11-218-0/+63
| | | | | | | | | | | | | | | | | | Test module usage across a `$<TARGET_OBJECTS>`-as-sources use case. See: #25425
* | | Merge topic 'clang-scan-deps-failed-scan' into release-3.28Brad King2023-11-221-2/+2
|\ \ \ | |/ / |/| | | | | | | | | | | | | | | | | 77a7edb73f Clang-CXX: copy into the dyndep output on success Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Namniav W <namniav@gmail.com> Merge-request: !8991
| * | Clang-CXX: copy into the dyndep output on successBen Boeckel2023-11-211-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When `clang-scan-deps` fails to scan (e.g., bad source syntax, junk flags, etc.), the redirection unconditionally updates the file. If this fails, the `.ddi` file timestamp is updated. If the state is then reverted (e.g., the command line returns to the state of the last successful build), the updated file is not useful, but `ninja` does not rerun because: - the command hash matches the last successful run - the output file is newer than its inputs However, since the `.ddi` file has been updated with bogus contents from a failed scan, collation fails as the `rules` array is empty (or incomplete from a batch scan). If `clang-scan-deps` were properly aware of its output file, it could use this to not write the file if any inner scan fails. Requested in https://github.com/llvm/llvm-project/issues/72875. See: https://github.com/llvm/llvm-project/issues/72875 Fixes: #25429
* | | Merge topic 'fileapi-file-sets-base-dirs-relative' into release-3.28Brad King2023-11-202-5/+5
|\ \ \ | |/ / |/| | | | | | | | | | | | | | | | | | | | 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-172-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | 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
* | | codespell: Fix typosBrad King2023-11-1710-11/+11
| | |
* | | Tests: Update HIP.MathFunctions case for nodiscard enforcementBrad King2023-11-171-4/+8
| | |
* | | Merge branch 'backport-target-objects' into target-objectsBrad King2023-11-145-0/+33
|\ \ \ | | |/ | |/|
| * | cmComputeLinkInformation: Track targets named by TARGET_OBJECTS sourcesBrad King2023-11-145-0/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | cmGeneratorExpressionNode: Fix short-circuit logicMartin Duffy2023-11-132-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | 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-082-3/+3
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | | Tests: Avoid compiling call to dap::optional<dap::string>(nullptr)Brad King2023-11-072-3/+3
| | | |
* | | | Xcode: Fix linking against .xcframework from static librariesKyle Edwards2023-11-063-0/+12
|/ / / | | | | | | | | | Issue: #21752
* | | cmSystemTools::RunSingleCommand(): Pass stdin to child processKyle Edwards2023-11-024-1/+8
| | | | | | | | | | | | Fixes: #25383
* | | Merge topic 'cxxmodules-cmp0155-graceful-fallback-without-scanner' into ↵Brad King2023-11-015-13/+14
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | | CMP0155: ignore scanning for sources if no scanner is availableBen Boeckel2023-11-015-13/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | Merge topic 'modules-depends-via-target-objects' into release-3.28Brad King2023-10-318-1/+68
|\ \ \ \ | | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | | Fortran: Restore support for TARGET_OBJECTS providing modulesBen Boeckel2023-10-307-0/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | | Tests/ObjectLibrary: fix commentBen Boeckel2023-10-271-1/+1
| | | |
* | | | Merge topic 'cxxmodules-ninja-forced-rsp-files' into release-3.28Brad King2023-10-303-0/+51
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 09c962a6a4 Tests/CXXModules: test forced rsp files with ninja Acked-by: Kitware Robot <kwrobot@kitware.com> Tested-by: buildbot <buildbot@kitware.com> Merge-request: !8926
| * | | | Tests/CXXModules: test forced rsp files with ninjaBen Boeckel2023-10-283-0/+51
| | |/ / | |/| | | | | | | | | | Fixes: #25367
* | | | CMP0153: Add suggestion to use execute_process()Kyle Edwards2023-10-272-1/+4
|/ / /
* | | cmNinjaTargetGenerator: do not order-depend on C++ module sourcesBen Boeckel2023-10-206-1/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | C++ module sources should not be included by any other TUs, so their presence cannot matter for order-only dependencies of the entire target. Exclude them. Update CMP0154 to take this into consideration and add tests to the `CXXModules` suite (which already deals with module support detection).
* | | Merge topic 'cxxmodules-vs-no-synthetic-targets' into release-3.28Brad King2023-10-186-1/+47
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | 17fd7fe2ae Tests/CXXModules: test Visual Studio synthetic target error badb6ab120 VS: Explicitly disallow C++ modules provided by imported targets Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !8895
| * | | Tests/CXXModules: test Visual Studio synthetic target errorBen Boeckel2023-10-176-1/+47
| | | |
* | | | Merge topic 'cxxmodules-export-fileset-info' into release-3.28Brad King2023-10-176-4/+29
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 0f36156740 cxxmodules: include `INCLUDES DESTINATION` directories Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !8886
| * | | | cxxmodules: include `INCLUDES DESTINATION` directoriesBen Boeckel2023-10-166-4/+29
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | These paths are added outside the normal property management mechanisms. Shuttle the value to the C++ module export as needed. Fixes: #25289
* | | | Merge topic 'execute_process-output_file-directory' into release-3.28Brad King2023-10-176-0/+22
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 35f031e3b2 execute_process(): Restore opening files relative to WORKING_DIRECTORY Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !8883
| * | | | execute_process(): Restore opening files relative to WORKING_DIRECTORYKyle Edwards2023-10-166-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prior to 5420639a, execute_process() would open INPUT_FILE, OUTPUT_FILE, and ERROR_FILE relative to the WORKING_DIRECTORY argument if it was provided. Restore this behavior for backwards compatibility. Fixes: #25338
* | | | | Tests/NinjaPrivateDeps: fix error message for Build-PrivateFileSet-checkBen Boeckel2023-10-161-1/+1
| |/ / / |/| | | | | | | | | | | The file *should* exist, so word the error message as such.
* | | | Autogen: Revert "AUTO*_EXECUTABLE: add support for per-config values"Orkun Tokdemir2023-10-1312-418/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changing the `timestamp` file to `timestamp_$<CONFIG>` causes some user projects to break when using Qt versions older than 6.6. Revert commit fddd0f0443 (Autogen: AUTO*_EXECUTABLE: add support for per-config values, 2023-06-14, v3.28.0-rc1~96^2~1) pending further investigation. Issue: #20074
* | | | Tests: Revert "NinjaMultiConfig: Update tests for the new dependency change"Orkun Tokdemir2023-10-133-40/+22
|/ / / | | | | | | | | | | | | | | | Revert commit e454314daa (NinjaMultiConfig: Update tests for the new dependency change, 2023-07-05, v3.28.0-rc1~96^2) because we are about to revert the change for which it updated tests.
* | | Merge topic 'cxxmodules-try_compile' into release-3.28Brad King2023-10-113-0/+26
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fd81024e80 cxxmodules: Honor CMAKE_CXX_SCAN_FOR_MODULES in try_compile Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Reviewed-by: Ben Boeckel <ben.boeckel@kitware.com> Merge-request: !8865
| * | | cxxmodules: Honor CMAKE_CXX_SCAN_FOR_MODULES in try_compileBrad King2023-10-103-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Under CMP0155's NEW behavior, projects that explicitly enable C++20 support with `set(CMAKE_CXX_STANDARD 20)` may also explicitly disable scanning with `set(CMAKE_CXX_SCAN_FOR_MODULES OFF)`. We already propagate `CMAKE_CXX_STANDARD` into `try_compile` test projects, so propagate `CMAKE_CXX_SCAN_FOR_MODULES` too. Fixes: #25313
* | | | cxxmodules: Reference documentation in no-modules-support diagnosticsBrad King2023-10-116-24/+34
| | | | | | | | | | | | | | | | | | | | | | | | Help users avoid errors about module support when they may not need it. While at it, polish sentence syntax in the diagnostic messages.
* | | | Tests: Enforce RunCMake.CXXModules no-modules-support diagnostics strictlyBrad King2023-10-116-36/+26
|/ / / | | | | | | | | | | | | Previously the expected output expressions used `(...)*` which did not actually have to match anything.
* | | Tests/RunCMake/CXXModules: remove experimental settingsBen Boeckel2023-10-072-4/+0
| | | | | | | | | | | | | | | Logical conflicts between the topic that introduced the tests and the removal of the experimental flag completely.
* | | cxxmodules: Scan only targets that explicitly enable C++ 20Brad King2023-10-053-0/+18
| | | | | | | | | | | | | | | | | | Previously we scanned any targets for which C++ 20 is enabled, even if enabled only by the compiler's default, such as when `CXXFLAGS=-std=c++20`.
* | | Tests: Modernize name of RunCMake.CXXModules compiler inspection caseBrad King2023-10-042-2/+2
| | | | | | | | | | | | We use the case name `Inspect` for similar purposes in other tests.
* | | Merge topic 'LLVMFlang-MSVC' into release-3.28Brad King2023-10-0417-3/+151
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 26bf32cdc6 LLVMFlang: Add support for targeting MSVC ABI on Windows e9af7b9687 LLVMFlang: Add support for CMAKE_Fortran_COMPILER_TARGET 26fa048ffe Tests: Enable CMP0091/CMP0141 for MSVC settings in FortranOnly test 9d060b8682 Fortran: Save CMAKE_LINKER variable persistently for MSVC ABI 7571e653f4 CMakeDetermineCompilerABI: Add option to skip implicit link info parsing 12733d0d8d CMakeParseImplicitLinkInfo: Detect link lines using link.exe and lld-link Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !8852