Commit Graph

28 Commits

Author SHA1 Message Date
Brad King
3524abf345 Merge topic 'build-database-fixes'
12d73c9f78 cmExperimental: recycle build database uuid
d02ca76184 cmDyndepCollation: record required modules to the build database
8a773168fd Tests/CXXModules: help diagnose build database errors
7ca4ac8e13 cmBuildDatabase: fix language comparison for visibility

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10414
2025-03-05 08:32:50 -05:00
Ben Boeckel
d02ca76184 cmDyndepCollation: record required modules to the build database 2025-03-03 22:03:27 +01:00
Kitware Robot
1772622772 LICENSE: Replace references to Copyright.txt with LICENSE.rst
```
git grep -lz 'Copyright.txt or https://cmake.org/licensing ' |
  while IFS= read -r -d $'\0' f ; do
    sed -i '/Copyright.txt or https:\/\/cmake.org\/licensing / {
              s/Copyright.txt/LICENSE.rst/
            }' "$f" ; done
```
2025-03-03 10:43:35 -05:00
Kitware Robot
0b96ae1f6a Revise C++ coding style using clang-format with "east const"
Run the `clang-format.bash` script to update all our C and C++ code to a
new style defined by `.clang-format`, now with "east const" enforcement.
Use `clang-format` version 18.

* 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.

Issue: #26123
2025-01-23 13:09:50 -05:00
Ben Boeckel
3e15419bd4 target_sources: Restore toleration of duplicate CXX_MODULES sources
In commit 9c0491a3e4 (cmDyndepCollation: write out scanned source
information too, 2024-03-25) via !9708, the `sf_map` gained a new job of
also being used to track non-file set sources which could import
modules. This was implemented by removing processed `FILE_SET TYPE
CXX_MODULES` sources from the map and working with the sources
remaining. When a `FILE_SET TYPE CXX_MODULES` source appeared multiple
times, this would then erroneously complain that it "was not scheduled
for compilation". Use a set of source paths to track sources that have
already been processed. If duplicates are found, trigger an author
warning and skip the duplicate file.

Fixes: #26549
2025-01-09 22:36:06 +01:00
Ben Boeckel
670f753f24 cmDyndepCollation: write build database metadata
Generators will hook this up into the build graph as needed.
2024-08-27 12:37:36 -04:00
Ben Boeckel
bea4fb7cd6 cmDyndepCollation: update template module database files if requested 2024-08-27 12:37:35 -04:00
Ben Boeckel
9c0491a3e4 cmDyndepCollation: write out scanned source information too
This is required to fill in the `requires` field for sources using
modules that do not provide them.
2024-08-27 12:37:35 -04:00
Ben Boeckel
1fba6d3233 Merge branch 'cxxmodules-build-export-different-directory-3.28' into cxxmodules-build-export-different-directory
* cxxmodules-build-export-different-directory-3.28:
  cmDyndepCollation: look at all `export(TARGETS)` calls
2024-05-01 22:09:43 -04:00
Ben Boeckel
ec35251510 cmDyndepCollation: look at all export(TARGETS) calls
Previously, only `export()` calls in the same directory were noticed.

Also add a test that exports in a different directory than the target
itself resides in.

Fixes: #25813
2024-05-01 22:08:35 -04:00
Brad King
4bf49bc437 Merge topic 'export-name-safe-name' into release-3.29
142a85f9c1 cxxmodules: use filesystem-safe export names in filenames
4452d41488 cmGeneratorTarget: add method to get a filesystem-safe export name

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !9474
2024-05-01 09:29:55 -04:00
Ben Boeckel
142a85f9c1 cxxmodules: use filesystem-safe export names in filenames
Also add tests.

Fixes: #25828
2024-04-30 09:05:16 -04:00
Brad King
b13aca575e Merge topic 'cxxmodules-collapse-source-paths' into release-3.29
0f0d853de7 cmDyndepCollation: collapse full path before looking up

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !9249
2024-02-15 12:54:39 -05:00
Ben Boeckel
0f0d853de7 cmDyndepCollation: collapse full path before looking up
`cmSourceFile::GetFullPath()` performs a `CollapseFullPath` before
storing the path. Match this behavior when looking up paths from the
source file set constructions.

Fixes: #25614
2024-02-14 11:51:05 -05:00
Craig Scott
4a76154e05 Merge topic 'cxxmodules-error-message-improvement'
4962eba981 cmDyndepCollation: clarify CXX_MODULES-without-BMI error message

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Acked-by: Yaraslau <yaraslau.tamashevich@gmail.com>
Merge-request: !9103
2024-01-03 07:19:09 -05:00
Ben Boeckel
4962eba981 cmDyndepCollation: clarify CXX_MODULES-without-BMI error message
Fixes: #25493
2023-12-26 11:07:15 -05:00
Kyle Edwards
a90968e044 cmExportBuildFileGenerator: Add structs for target exports 2023-11-14 09:22:53 -05:00
Ben Boeckel
24a9b00f83 Merge branch 'cxxmodules-non-compiled-source-release' into cxxmodules-non-compiled-source
* cxxmodules-non-compiled-source-release:
  cxxmodules: detect and message about non-compiled sources
2023-09-12 14:47:20 -04:00
Ben Boeckel
458e3974a8 cxxmodules: detect and message about non-compiled sources
Previously an internal error was raised which ended up causing an
internal exception to be thrown. This is a typo situation that should
fall into an explicit error.

Fixes: #25207
2023-09-12 14:46:36 -04:00
Ben Boeckel
c1defd9dd3 cmDyndepCollation: add initializers for POD types
This avoids invalid states from existing.
2023-08-17 14:42:53 -04:00
Ben Boeckel
a53748e319 cmDyndepCollation: add a query for whether an object is BMI-only
The collator needs to know that the object *is* a BMI so that it can
just use the location directly.
2023-08-17 14:42:53 -04:00
Ben Boeckel
9840bfdab0 cmDyndepCollation: support BMI-only collation 2023-08-17 14:42:53 -04:00
Tyler
28ece63fee cxxmodules: Fix exported path to installed module sources in subdirs
When generating the `IMPORTED_CXX_MODULES_[CONFIG]` target property,
there was a missing path separator after a non-empty relative directory
part of the path to a module source file.

Co-authored-by: Brad King <brad.king@kitware.com>
2023-05-23 15:01:52 -04:00
Ben Boeckel
8207a3a266 cmDyndepCollation: add a query for visibility of an object's modules
This will be used to hide private modules from the view of consuming
targets.
2023-05-15 22:26:36 -04:00
Brad King
d9d74b5e8a cmDyndepCollation: Drop outdated mentions of CXX_MODULE_INTERNAL_PARTITIONS
These were left from an older design iteration in which, for MSVC, we
needed to distinguish `cl -internalPartition` from `cl -interface`
before scanning.  It is no longer needed since `cl -scanDependencies`
was updated to use the standard-conforming interpretation of
non-exported module partition syntax.

Issue: #24611
2023-03-18 11:52:42 -04:00
Ben Boeckel
f4a17b29d3 cmDyndepCollation: factor out metadata writing for dyndep 2022-11-30 10:53:45 -05:00
Ben Boeckel
2f93a272d0 cmDyndepCollation: factor out parsing dyndep information 2022-11-30 10:53:45 -05:00
Ben Boeckel
3fc2de5c74 cmDyndepCollation: factor out writing C++ module info from Ninja
To facilitate other generators being able to build C++20 modules, start
pulling out collator logic into a generator-agnostic location.

This commit starts by factoring out the information written to the
"target depend info" object consumed during the build to handle writing
out export and installation scripts expected during those steps.
2022-11-30 10:53:45 -05:00