| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
This will help the collator choose flags and path styles for modmap
files.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These directories are used to direct collators for Fortran and C++
modules to consume dependent module information to properly collate.
However, the consumption of these files merely checks for existence of
the file, not whether they are actually needed anymore.
The problem arises when a target has Fortran or C++ modules at point A,
a build occurs populating this file, and then the target is updated to
no longer have potential modules. The `DependInfo.make` (for
`Makefiles`) or `<LANG>DependInfo.json` (for `Ninja`) files still exist
as they are never guaranteed to be cleaned up. This can introduce stale
information to the build which may cause a false-positive compilation if
a module file happens to still exist and gets found this way.
Instead, query the `linked-target-dirs` using the language in question
and only add the directory if it contains potential sources for modules
coming from the language in question.
|
|
|
|
|
|
|
|
|
|
| |
These patches now support the `-MF` output, so remove the `none` support
added just for the old patchset which did not use it.
Also update the flag name to `-fmodule-output=`.
Due to the new Clang module mapper flag, use a new experimental support
UUID as well.
|
|\
| |
| |
| |
| |
| |
| |
| | |
232467eb1c clang-tidy: add <LANG>_CLANG_TIDY_EXPORT_FIXES_DIR property
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7982
|
| |
| |
| |
| | |
Fixes: #21362
|
| |
| |
| |
| |
| | |
The `clang` mechanism does not support `depfile` discovered dependencies
at the moment.
|
|/ |
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
|
| |
The `CXX_SCAN_FOR_MODULES` property may be used to control scanning for
targets and for source files rather than assuming "C++20 always needs to
be scanned".
|
|
|
|
|
| |
This information is now needed in more than one place, so factor the
logic out and use it to build a cache.
|
|\
| |
| |
| |
| |
| |
| |
| | |
887a8874c3 EXPORT_COMPILE_COMMANDS: add `output` field
Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !7844
|
| |
| |
| |
| |
| |
| |
| |
| | |
Also write for all configurations from multi-config generators.
This field was added in the Clang 5 documentation and not present in the
Clang 4 documentation (sometime between Dec 2016 and Mar 2017 according
to `web.archive.org`).
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Swift is used as the linker for non-swift files because it needs to pull
files like swiftrt.o in when swift symbols are present to ensure that
the swift runtime is linked.
The swift driver uses clang as the underlying linker, which pulls in
crtbegin.o and friends when appropriate, so using Swift as a linker for
C/C++ libraries is fine.
The output-file-map was getting passed to all Swift invocations,
regardless of whether or not we generated one. This patch changes it so
that we only include the output-file-map in the Swift compiler
invocation if we have actually generated the file.
|
|
|
|
| |
Fixes: #23441
|
|
|
|
|
|
|
|
| |
compile_commands.json was being written for every permutation of
cross configurations. Deduplicate so only one command is output
for each configuration.
Fixes: #23733
|
| |
|
|
|
|
|
| |
The collator will use this to know where the target's export information
needs to go so that module properties may be provided.
|
|
|
|
|
| |
The collator will use this to generate property settings for the
imported targets in the build and install export sets.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
C++ modules have two variants which are of importance to CMake:
- `CXX_MODULES`: interface modules (those using `export module M;`,
`export module M:part;`, or `module M:internal_part;`)
- `CXX_MODULE_HEADER_UNITS`: importable header units
Creating C++ modules or partitions are *not* supported in any other
source listing. This is because the source files must be installed (so
their scope matters), but not part of usage requirements (what it means
for a module source to be injected into a consumer is not clear at this
moment). Due to the way `FILE_SET` works with scopes, they are a perfect
fit as long as `INTERFACE` is not allowed (which it is not).
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
The ninja generator has been updated to poperly write the compile
database when the CUDA language has been enabled.
Fixes #23368
|
|
|
|
|
|
| |
Fix spurious warnings from gfortran+Ninja for preprocessing.
Fixes: #23248
|
|
|
|
|
|
| |
It is unused since commit c564a3e3ff (Ninja: Always compile sources
using absolute paths, 2021-05-19, v3.21.0-rc1~129^2), which left
behind a FIXME comment to eventually remove it.
|
|\
| |
| |
| |
| |
| |
| |
| | |
73b84db62d Ninja: Fix creation of Windows import library directory
bd36735f65 cmNinjaTargetGenerator: Replace "their" with "there" in comment
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6694
|
| | |
|
|/
|
|
|
|
| |
The target properties `CUDA_SEPARABLE_COMPILATION` and `CUDA_PTX_COMPILATION`
now aren't mutually exclusive and can now be used together on the same
target.
|
| |
|
|\
| |
| |
| |
| |
| |
| |
| | |
ccfe1b0b40 IWYU: Add `--driver-mode=cl` when applicable
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !6511
|
| |
| |
| |
| |
| |
| | |
We already do this for `clang-tidy`.
Fixes: #16554
|
|/ |
|
| |
|
|
|
|
|
|
|
|
|
| |
When running the module dependencies scan tool for for a language that
does not compile the preprocessed output, we do not actually put the
preprocessed output in the build graph. However, the value of
`CMAKE_EXPERIMENTAL_<LANG>_SCANDEP_SOURCE` may reference the placeholder
for the preprocessed source. Populate the placeholder to keep the file
out of the way. In particular, do not clobber the `.ddi` file.
|
|
|
|
|
| |
Use the `compilePP` variable directly rather than relying on callers
to make `compilePP == !ppFileName.empty()`.
|
|
|
|
|
|
| |
Since commit 33a8e0bb09 (cmNinjaTargetGenerator: Simplify scan rule
depfile selection, 2020-11-06, v3.20.0-rc1~516^2~1), the `$out` of the
scan rule always matches our `.rsp` file selection, so use `$out.rsp`.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The Ninja generator traditionally referenced source files and include
directories using paths relative to the build directory if they could be
expressed without a `../` sequence that leaves the build and source
directories. For example, when using a `build/` directory inside the
source tree, sources would be compiled as `-c ../src.c` and include
directories would be referenced as `-I ../include`. This approach
matches the traditional Ninja convention of using relative paths
whenever possible, but has undesirable side effects such as:
* Compiler diagnostic messages may not use absolute paths, making it
harder for IDEs/editors to find the referenced sources or headers.
* Debug symbols may not use absolute paths, making it harder for
debuggers to find the referenced sources or headers.
* Different results depending on the path to the build tree relative
to the source tree.
* Inconsistent with the Makefile generators, which use absolute paths.
Switch to always using absolute paths to reference source files and
include directories on compiler command lines. While alternative
solutions for diagnostic messages and debug symbols may exist with
specific tooling, this is the simplest and most consistent approach.
Note that a previous attempt to do this in commit 955c2a630a (Ninja: Use
full path for all source files, 2016-08-05, v3.7.0-rc1~275^2) was
reverted by commit 666ad1df2d (Revert "Ninja: Use full path for all
source files", 2017-02-24, v3.8.0-rc2~9^2) due to problems hooking up
depfile dependencies on generated files. This time, the changes in
commit 2725ecff38 (Ninja: Handle depfiles with absolute paths to
generated files, 2021-05-19) should avoid those problems.
Fixes: #13894, #17450
|
|
|
|
|
|
| |
The `GetSourceFilePath` method is meant only for compiled sources, and
automatically handles converting it to a path for the Ninja build
manifest. Rename the method to clarify both.
|
|
|
|
|
| |
Reference external object files using `ConvertToNinjaPath` directly.
`GetSourceFilePath` is meant to reference source files to be compiled.
|
| |
|
|
|
|
| |
`GetSourceFilePath` already handles converting to a Ninja path.
|
|
|
|
|
|
|
| |
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.
|
| |
|
|\
| |
| |
| |
| |
| |
| | |
ad08f93ee4 Ninja Multi-Config: Split long command lines by config
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6067
|
| |
| |
| |
| | |
Fixes: #22123
|
|/
|
|
|
|
|
|
|
|
|
|
|
| |
Make the `config` argument non-optional so all callers must be explicit.
Convert the path style argument to an enumeration to make its role clear
at call sites.
The path style argument is implemented by `ConvertToIncludeReference`,
which was introduced with the Ninja generator by commit 5b114c9bee
(Introduce a cmLocalGenerator::ConvertToIncludeReference function,
2011-09-07, v2.8.7~187^2~4). Its only purpose is to allow the Ninja
generator to use relative paths in `-I` flags. Add a comment explaining
this role.
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
39cbbb59a5 ninja: add experimental infrastructure to generate gcc-format modmap files
791b4d26d6 ninja: add experimental infrastructure to generate modmap files with dyndep
4b23359117 ninja: Add experimental infrastructure for C++20 module dependency scanning
f814d3b3c6 cmNinjaTargetGenerator: use $OBJ_FILE for the object
b0fc2993e1 Treat the '.mpp' file extension as C++ code
988f997100 cmScanDepFormat: Fix name of our internal tool in parse errors
dacd93a2db ninja: De-duplicate version numbers required for ninja features
533386ca29 cmStandardLevelResolver: Factor out helper to capture stoi exceptions
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Ben Boeckel <ben.boeckel@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Acked-by: Shannon Booth <shannon.ml.booth@gmail.com>
Merge-request: !5562
|