| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
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.
|
|\
| |
| |
| |
| |
| |
| | |
40e73c5ac4 Source: Fix typo in _WIN32 preprocessor checks
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6631
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Since CMake's default compiler flags with MSVC include `-DWIN32` for
historical reasons, a few preprocessor conditions were accidentally
checking for `WIN32` instead of `_WIN32`. The corresponding blocks
were left out when compiling official binaries for `cmake.org` because
we hard-code compiler flags without `-DWIN32`.
Fixes: #22764
|
| | |
|
| | |
|
| |
| |
| |
| | |
Use a name that is not ninja-specific.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |
| |
| |
| |
| | |
`ConvertToIncludeReference` is only called with absolute paths.
One branch already assumed this.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Ninja treats every (normalized) path as its own node. It does not
recognize `/abs/path/to/file` in a depfile as matching `path/to/file`
even when `build.ninja` and the working directory are in `/abs/`.
See Ninja Issue 1251. In cases where we pass absolute paths to the
compiler, it will write a depfile containing absolute paths. If those
files are generated in the build tree by custom commands, `build.ninja`
references them by relative path in build statement outputs, so Ninja
does not hook up the dependency and rebuild the project correctly.
Add infrastructure to work around this problem by adding implicit
outputs to custom command build statements that reference the main
outputs by absolute path. Use a `${cmake_ninja_workdir}` placeholder
to avoid repeating the base path. For example:
build out.txt | ${cmake_ninja_workdir}out.txt: CUSTOM_COMMAND ...
Ninja will create two nodes for the output file, one with a relative
path and one with an absolute path. A depfile may then mention either
form of the path and Ninja will hook up the dependency. Unfortunately
Ninja will also stat the file twice.
Issue: #13894
Fixes: #21865
|
| |
| |
| |
| |
| |
| | |
De-duplicate code paths calling ConvertToNinjaPath and
SeenCustomCommandOutput on custom command outputs and custom target
byproducts.
|
| |
| |
| |
| |
| | |
Re-order arguments to group those with similar roles.
Use move semantics to avoid copying vectors of strings.
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| | |
Most calls to `MaybeConvertToRelativePath` use one of our common work
directories (e.g. top of the build tree) as the local path. Add helpers
for each of the common cases to simplify and clarify call sites.
|
|\ \
| | |
| | |
| | |
| | |
| | |
| | | |
ad08f93ee4 Ninja Multi-Config: Split long command lines by config
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6067
|
| | |
| | |
| | |
| | | |
Fixes: #22123
|
| | |
| | |
| | |
| | |
| | |
| | | |
This facility is very useful for 'Ninja Multi-Config' and required
as well for future support of DEPFILE in 'Xcode' and 'Visual Studio'
generators (#20286).
|
|\ \ \
| |/ /
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
6dd89529e8 Ninja Multi-Config: Fix crash on custom command config with no output
e21a80e97d Tests: Teach RunCMake to ignore incidental 'Recompacting log' ninja output
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kyle Edwards <kyle.edwards@kitware.com>
Merge-request: !5950
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
With generator expressions in a custom command's `OUTPUT` and
`BYPRODUCTS`, it is possible to have no outputs at all for a particular
configuration. Generate no rule in this case.
Fixes: #21989
|
|\ \ \
| |/ /
| | |
| | |
| | |
| | |
| | | |
3b864b2583 Ninja Multi-Config: Include configs in long CC scripts
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5941
|
| | |
| | |
| | |
| | | |
Fixes: #21973
|
|\ \ \
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
9af6e2e7b2 Ninja: Use new wincodepage tool to determine encoding
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5860
|
| |/ /
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Ninja 1.11 and later uses UTF-8 on Windows when possible, and
includes a tool that reports the code page in use. Use this tool
to determine what encoding to write the Ninja files in.
Fixes: #21866
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
|
| | |
|
| |
| |
| |
| | |
Fixes: #21252
|
| |
| |
| |
| | |
Fixes: #21063
|
| |
| |
| |
| | |
Co-Author: Brad King <brad.king@kitware.com>
|
| |
| |
| |
| |
| |
| |
| | |
Add support for constructing and using multiple generators for one
custom command. cmGeneratorTarget contains a code path that needs this
behavior when used with Ninja but not other generators, so use virtual
dispatch through cmLocalGenerator.
|
| | |
|
|/
|
|
| |
Fixes: #21267
|
| |
|
| |
|
| |
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
ef796cc743 cmGeneratorTarget: Skip computing link implementation for custom targets
45158b2afe cmGeneratorTarget: Simplify logic in ComputeLinkInterfaceLibraries
d6b1f5704e cmGeneratorTarget: Add missing nullptr checks
7695b67500 cmComputeTargetDepends: Add missing nullptr check
95b5df8646 cmGeneratorTarget: Skip computing languages for custom targets
2f0790df50 Factor out generator checks for filtering on non-compiling targets
422d9a0ab2 Factor out generator checks for filtering out interface libraries
bce82df0aa cmGeneratorTarget: Remove unnecessary target type check in dependency tracing
...
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kyle Edwards <kyle.edwards@kitware.com>
Merge-request: !5038
|
| |
| |
| |
| |
| |
| | |
Add a `cmGeneratorTarget::IsInBuildSystem` helper method to tell
generators whether a target should participate in the generated build
system.
|
|/ |
|
| |
|
| |
|
|\
| |
| |
| |
| |
| |
| | |
dddb4f02f7 Ninja Multi-Config: Make "install" targets depend on default configs
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4778
|
| |
| |
| |
| |
| |
| | |
And add an "install:all" target.
Fixes: #20713
|
| | |
|
|\ \
| | |
| | |
| | |
| | |
| | |
| | | |
3fdd8db3aa Refactor: Avoid `std::endl` where it's not necessary (part 1)
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4513
|
| |/
| |
| |
| |
| |
| |
| | |
The `std::endl` manupulator, except inserting `\n` character, also
performs `os.flush()`, which may leads to undesired effects (like
disk I/O in the middle of forming data strings). For the
`std::stringstream` it also has no meaning.
|
|\ \
| | |
| | |
| | |
| | |
| | |
| | | |
c84cf42897 cmState::GetGlobalProperty: return cmProp
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4521
|
| |/ |
|
|/ |
|
| |
|