1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-05-12 16:15:54 +08:00

17 Commits

Author SHA1 Message Date
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
0e9782b336 msvc: bless MSVC 19.34 support for C++ modules as experimental
Visual Studio 17.4 now contains official support for what CMake needs.
2022-11-11 16:54:05 -05:00
Ben Boeckel
a84c186a7d cmScanDepFormat: support the MSVC 17.3 toolchain temporarily
At least until 17.4 is out.
2022-08-02 10:53:38 -04:00
Ben Boeckel
d7f5064ff7 cmScanDepFormat: support P1689R5
This adds the `is-interface` key on provides fields.
2022-07-26 12:25:42 -04:00
Brad King
9ed1d7bee6 cmScanDepFormat: Accept P1689r4 files with version 1
VS 2022's `cl` 19.30 has a `-scanDependencies` option that produces the
P1689r4 format.  It reports the "version" field with value "1".
2021-11-03 10:50:54 -04:00
Brad King
10b2e53469 cmScanDepFormat: Remove Fortran-specific compiled-module-path logic
Read and write the `compiled-module-path` field only when explicitly
known.  Move the assumption that the `compiled-module-path` can be
derived from the logical module name from the scandep parser to the
`cmake_ninja_dyndep` helper.
2021-06-15 09:09:28 -04:00
Brad King
2b9890e9b9 cmScanDepFormat: Avoid writing lookup-method with default value 2021-06-15 08:48:05 -04:00
Ben Boeckel
ccc0466fc5 cmScanDepFormat: P1689R4: Implement source-path related fields 2021-06-10 07:55:20 -04:00
Ben Boeckel
3e5b609547 cmScanDepFormat: P1689R4: Make work-directory optional 2021-06-09 11:02:25 -04:00
Ben Boeckel
aab9a5fc3e cmScanDepFormat: P1689R4: Factor out primary-output field 2021-06-09 10:51:02 -04:00
Ben Boeckel
b0a8fa959c cmScanDepFormat: P1689R4: Diagnose invalid provides/requires json type 2021-06-09 10:50:56 -04:00
Ben Boeckel
82c867ad85 cmScanDepFormat: P1689R4: Flatten future-compile members into parent 2021-06-09 10:50:41 -04:00
Brad King
bd12b97d05 cmScanDepFormat: Drop unused "outputs", "inputs", and "depends" fields
These fields are specified by our `P1689r3` paper, but are not actually
needed.  The dependencies of the scanning results themselves can be
captured via normal depfile logic.  Avoid saving this possibly-large
information in the scanning results.  It is not needed by later steps.
2021-05-13 08:33:00 -04:00
Brad King
3a71534402 Ninja: Restore support for Fortran in a symlinked build tree
Since commit f3eed2c49d (cmGlobalNinjaGenerator: use P1689 dependency
file format for Fortran, 2019-03-12, v3.20.0-rc1~454^2), Fortran stopped
working in a build tree whose path contains a symlink.  The reason is
that the P1689r3 format's `work-directory` field gets populated with the
realpath (via `getcwd`) of the build tree instead of the logical path to
the build tree used for generating relative paths in `build.ninja`.
This causes the `Fortran.dd` file to get absolute (real)paths to `.o`
files, and Ninja does not match them with the relative `.o` file paths
in `build.ninja`.

Fix this by dropping use of the `work-directory` field.  This restores
our prior approach of generating paths in the dyndep file using the same
forms of paths received from the buildsystem generator.  The P1689r3
paper's format may need to be revised to account for this.

Fixes: #21683
2021-05-12 10:15:43 -04:00
Brad King
988f997100 cmScanDepFormat: Fix name of our internal tool in parse errors
We parse the scan result `.ddi` files in `-E cmake_ninja_dyndep`,
not `-E cmake_ninja_depends`.
2021-01-05 09:29:18 -05:00
Brad King
2cb1d77c58 scandep: update format to P1689 R3
The `work-directory` field has been moved into individual rules since
each one may correspond to a different compiler invocation and therefore
a different work directory.

Support for arbitrary binary paths has been removed for simplicity.
We now assume paths have a valid UTF-8 round-trip representation.
2020-11-18 10:42:57 -05:00
Ben Boeckel
a02c4ccabc cmScanDepFormat: add reader and writer for the format from P1689R2
This format is currently subject to change, but is not too far from the
end goal.

Some bits are currently unimplemented (see TODO comments).
2020-11-17 13:16:05 -05:00