summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/CXXModules
Commit message (Collapse)AuthorAgeFilesLines
* Merge topic 'cxxmodules-transitive-std' into release-3.28Brad King2024-02-212-2/+2
|\ | | | | | | | | | | | | f0df692d21 Tests/CXXModules: test `cxx_std_20` coming from a dependency Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !9276
| * Tests/CXXModules: test `cxx_std_20` coming from a dependencyBen Boeckel2024-02-202-2/+2
| | | | | | | | Closes: #25569
* | cmExportFileGenerator: export link libraries as-isBen Boeckel2024-02-204-4/+4
| | | | | | | | | | | | | | This allows for transitive modules to work because `$<COMPILE_ONLY>`-wrapped dependencies do not end up in the `linked-target-dirs` collator property. Test suite exported property tests updated to account for the change.
* | Tests/CXXModules: test transitive modules usageBen Boeckel2024-02-2014-0/+294
|/
* Tests/CXXModules: add a test with transitive targetsBen Boeckel2024-02-1921-0/+307
|
* Tests/CXXModules: add a test importing from a `Ninja` installBen Boeckel2024-02-168-0/+78
| | | | | | | This ensures that consuming from a single configuration generator works in all generators. See: #25568
* Tests/CXXModules: support building a project with `Ninja`Ben Boeckel2024-02-161-0/+29
| | | | This allows testing mixed generator setups.
* Tests/CXXModules: document `CMake_TEST_MODULE_COMPILATION` itemsBen Boeckel2024-02-161-0/+12
|
* Merge topic 'cxxmodules-collation-restat' into release-3.28Brad King2024-02-167-2/+59
|\ | | | | | | | | | | | | | | a7424b636b Ninja: make the collator rule use `restat = 1` e24eecfc33 Tests/CXXModules: add a test to ensure that `restat` works for collation Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !9259
| * Tests/CXXModules: add a test to ensure that `restat` works for collationBen Boeckel2024-02-157-2/+59
| | | | | | | | | | | | | | Also update the `modules-json-file` test to account for the fact that `CXXModules.json` is not updated for timestamp-only rebuild triggers. See: #25511
* | Merge topic 'cxxmodules-visibility-change-rebuild' into release-3.28Brad King2024-02-166-0/+55
|\ \ | |/ | | | | | | | | | | | | | | 60a8736378 cmNinjaTargetGenerator: scanning depends on the module metadata 52036ce090 Tests/CXXModules: test that objects depend on dependent modules json files 9a45c9fbd5 cmNinjaTargetGenerator: use `emplace_back` for scanning deps Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !9247
| * Tests/CXXModules: test that objects depend on dependent modules json filesBen Boeckel2024-02-156-0/+55
| |
* | Merge topic 'cxxmodules-depend-on-modmap-file' into release-3.28Brad King2024-02-166-0/+62
|\ \ | |/ | | | | | | | | | | | | | | 363300ace5 cxxmodules: depend on the modmap contents 940628d48d Tests/CXXModules: test that objects depend on their modmap files 681ee92030 Tests/CXXModules: support testing rebuild conditions Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !9248
| * Tests/CXXModules: test that objects depend on their modmap filesBen Boeckel2024-02-156-0/+49
| |
| * Tests/CXXModules: support testing rebuild conditionsBen Boeckel2024-02-141-0/+13
| |
* | cmDyndepCollation: collapse full path before looking upBen Boeckel2024-02-144-0/+31
|/ | | | | | | | `cmSourceFile::GetFullPath()` performs a `CollapseFullPath` before storing the path. Match this behavior when looking up paths from the source file set constructions. Fixes: #25614
* cxxmodules: make export trampoline script files uniqueBen Boeckel2024-01-185-11/+73
| | | | | | | | | | | Include the name of the `EXPORT` in the filename when generating export information for C++ modules. This allows the same directory to be used for multiple sets of C++ module-using targets. For `export(TARGETS)` uses, generate a name based on the hash of the concatenation of the target names involved with the `export()` call. Fixes: #25609
* cxxmodules: compute link information for C++ module-consuming targetsMatheus Izvekov2024-01-144-0/+20
| | | | | | | | | 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
* Merge topic 'vs-scan-for-modules' into release-3.28Brad King2024-01-106-3/+40
|\ | | | | | | | | | | | | | | | | | | 405dc7d19c Tests/CXXModules/scan_properties: use `ixx` extension 029ddc3410 cmVisualStudio10TargetGenerator: always specify scanning 6c9614cbf4 Tests/CXXModules: add a test case for VS generation without flags 34f4423851 cmVisualStudio10TargetGenerator: fix typo in flag name Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !9104
| * Tests/CXXModules/scan_properties: use `ixx` extensionBen Boeckel2024-01-092-3/+5
| | | | | | | | This ensures that Visual Studio is told not to scan this explicitly.
| * Tests/CXXModules: add a test case for VS generation without flagsBen Boeckel2024-01-064-0/+35
| | | | | | | | | | | | | | Previously, the `ScanSourceForModuleDependencies` flag was not added to the VS project if "nothing" prompted custom flags. See: #25519
* | Tests/CXXModules: add a test with unity build supportBen Boeckel2024-01-057-0/+68
|/ | | | | C++ module-using TUs cannot participate in unity builds. Add a test case for this situation.
* Merge topic 'cxxmodules-msvc-corner-cases' into release-3.28Brad King2023-12-065-3/+27
|\ | | | | | | | | | | | | | | e63983956d Tests/CXXModules: enhance `internal-partitions` test 8a658fb9ec Tests/CXXModules: import from an internal partition Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !9039
| * Tests/CXXModules: enhance `internal-partitions` testBen Boeckel2023-12-054-1/+17
| | | | | | | | | | | | This test previously did not *require* that the internal partition be specified as a transitive usage because nothing from it was exposed. Plumb through usages such that the internal partitions are required.
| * Tests/CXXModules: import from an internal partitionBen Boeckel2023-12-053-2/+10
| | | | | | | | | | | | It is reported that MSVC doesn't support the `modname=` syntax in its `-reference modname=modname.ifc` for internal partitions. Add a test case.
* | 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.
* 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.
* Merge topic 'fortran-objects-as-sources-fix' into release-3.28Brad King2023-11-276-0/+6
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | 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 '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
* | Tests/CXXModules: test forced rsp files with ninjaBen Boeckel2023-10-283-0/+51
|/ | | | Fixes: #25367
* 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
| |
* | 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 '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.
* cxxmodules: scan C++ sources for imports by defaultBen Boeckel2023-10-0243-38/+71
| | | | | Existing projects are not using C++ modules in their sources, so introduce policy CMP0155 to enable scanning by default.
* cxxmodules: rework control logic for scanning regular C++ sourcesBen Boeckel2023-10-0210-23/+58
| | | | | | | | | | | Now that scanning support is no longer experimental, the logic for whether or not to scan C++ 20 sources is now important because all projects are now exposted to the logic. Make the scanning rules explicit in the documentation and rework the queries to localize all of the associated logic. A policy to handle the ultimate fallback logic will be implemented in a following commit.
* Tests/RunCMake/CXXModules: remove rules file requirementBen Boeckel2023-10-021-12/+2
| | | | | Only Clang needs to disable extensions in order to work; other implementations work as-is.
* CXXModules: remove `EXPERIMENTAL` from C++ module variable namesBen Boeckel2023-10-0211-12/+12
|
* cmExperimental: remove the flag for C++ modulesBen Boeckel2023-10-0268-339/+0
| | | | | | | All the major compilers now have scheduled releases with support for scanning, so remove the experimental gate. Fixes: #18355