| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Since commit 8f82e755f3 (Ninja: Fix detection of MSVC showIncludes
prefix in Italian, 2023-01-26, v3.26.0-rc1~20^2) our regex no longer
matches the output from `msvc-wine`, which uses forward slashes:
Note: including file: /path/to/foo.h
`cl /showIncludes` under Wine prints paths of the form `Z:\path\to\file`,
but the `msvc-wine` wrapper converts them to the form `/path/to/file` so
that native Ninja can be used. Update our regex to match the prefix
followed by a path with a leading forward slash.
Fixes: #24908
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Since commit 8f82e755f3 (Ninja: Fix detection of MSVC showIncludes
prefix in Italian, 2023-01-26, v3.26.0-rc1~20^2) our regex no longer
matches the output from `clang-cl`, which uses a relative path, forward
slashes, and is always in English [1]:
Note: including file: ./foo.h
Update the regex to match that too.
[1] https://github.com/llvm/llvm-project/blob/llvmorg-16.0.0/clang/lib/Frontend/HeaderIncludeGen.cpp#L102
Co-authored-by: Brad King <brad.king@kitware.com>
|
|
|
|
|
|
| |
The prefix does not have two colons. Update our regex.
Fixes: #24357
|
|
|
|
| |
Add cases for English, French, German, and Japanese.
|
|
|
|
| |
Prepare to add support for more languages.
|
|
|
|
| |
Verify that the prefix is separated from the path.
|
|
|
|
|
|
|
|
|
| |
Generalize the fix from commit 37a279f8d1 (Ninja: Write msvc_deps_prefix
as UTF-8 when console codepage is UTF-8, 2020-07-31, v3.19.0-rc1~349^2).
`cl /showIncludes` output is encoded using the console output code page,
so this is the byte sequence that Ninja must use to match its lines.
Fixes: #24068
|
|\
| |
| |
| |
| |
| |
| |
| | |
a12050666c Tests: Add case for ninja with non-ascii chars
02a04dd9c7 Ninja: Restore support for non-ascii paths on Windows with ninja<=1.10
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7833
|
| |
| |
| |
| | |
Issue: #24089
|
|/
|
|
| |
Fixes: #23464
|
|
|
|
|
|
|
|
|
|
|
|
| |
The minimum CMake version for Qt6 is 3.16, so all the calls to
cmake_minimum_required() are updated here to enforce that
minimum. This will avoid any CMake version-related warnings
from Qt.
Avoid hard-coding Qt5 where the tests could now be using
Qt5 or Qt6.
Fixes: #22188
|
|
|
|
| |
FYI, NINJA_STATUS is "[%f/%t] " by default.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
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).
|
| |
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
339dbc901f Help: Note that CMP0116 is recorded at the time of CC creation
e3740e020e Tests: Test Qt autogen target with CMP0116 set to WARN
cf34011ce7 Tests: Test per-CC behavior of CMP0116
3a95503512 Ninja: Use CMP0116 status recorded at time of custom command's creation
f01f10e8fb cmCustomCommand: Record value of CMP0116 at time of creation
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5848
|
| | |
|
|\ \
| |/
|/|
| |
| |
| |
| | |
d33c2c93d8 Tests: Update for upstream ninja change to write status on stderr
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5850
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Upstream ninja commit `ad3d29fb53` (Put builder output through status
interface) from ninja PR 1899 changed the status output from stdout to
stderr. In particular, `ninja: no work to do` is now printed on stderr.
Update our RunCMake tests to accept this difference.
A few RunCMake test cases check for `ninja: no work to do`. For those,
move the message to stdout using `RunCMake_TEST_OUTPUT_MERGE`. The rest
of the test cases do not care about the message, so remove it from the
actual stderr content before comparing against that expected.
|
| |
| |
| |
| | |
Fixes: #21467
|
| |
| |
| |
| |
| |
| | |
* Adjusting the (unrelated) RunCMake.Ninja test to set CMP0118 to `NEW`.
* Adjusting the (unrelated) RunCMake.FileAPI test to set CMP0118 to
`NEW`.
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Adding tests for CMP0118 being unset (aka set to `WARN`).
* Adjusting the (unrelated) RunCMake.CMP0026 test to set CMP0118 to
`NEW`,
* Adjusting the (unrelated) RunCMake.Ninja test to set CMP0118 to `OLD`.
* Adjusting the (unrelated) RunCMake.FileAPI test to set CMP0118 to
`OLD`.
Note:
Setting CMP0118 to `NEW` and modifying the `GENERATED` property with
`set_property` or `set_source_files_properties` will currently NOT set
that property because the implementation is still to come.
|
| |
|
|\ |
|
| |
| |
| |
| |
| |
| | |
When using Qt 5.15.0 or above together with Ninja, check that touching
a source file of a dependency does not needlessly re-run AUTOMOC for
the dependee target.
|
|\ \
| |/
|/| |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
On Windows, toolchains like MSVC require a set of environment variables
to be configured for the compiler to work correctly. The scripts that
prepare these environments typically put the compiler's directory ahead
of others in the `PATH`. Teach the Ninja generators to use this as a
heuristic to select the compiler when none is explicitly specified.
This is not necessary with Makefile generators because each toolchain's
environment comes with its own make tool variant, and the corresponding
Makefile generator (e.g. "NMake Makefiles") automatically implies the
matching compiler.
Fixes: #20585
|
|/
|
|
| |
Fixes: #20621
|
|
|
|
|
|
|
| |
With Ninja 1.10 we run the cleandead and recompact tools after
generation. These require that `build.ninja` be loadable. Update the
`CustomCommandJobPool` case to define the referenced job pools to make
`build.ninja` loadable.
|
|
|
|
| |
Co-Authored-by: vector-of-bool <vectorofbool@gmail.com>
|
|
|
|
|
|
|
|
|
| |
Root causes were:
* Using incorrect conditions (assuming MSVC-like command line mode)
* Trying to compile the MSVC STL in C++11 mode, when parts of it require
C++14 or enabling MS extensions in clang.
* Missing flush in a testcase using stdout in a dll and a main part
with static crt
|
|
|
|
|
|
|
|
|
|
| |
Provide a way for custom commands and targets to set the pool variable
of the ninja build statement. Setting `JOB_POOL` is not compatible with
`USES_TERMINAL`, which implies the `console` pool.
The option is silently ignored with other generators.
Closes: #18483
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Represent the input file path internally in canonical form. Otherwise
multiple `configure_file` calls that share the same input file but specify
it relative to different directories (e.g. via `../`) result in multiple
copies of the dependency on the rule to re-run CMake. This causes the
Ninja generator to emit duplicate phony build statements for these
dependencies, which generates an error with `-w dupbuild=err`, which
will be default in Ninja 1.9.
Also canonicalize the output path for consistency.
Add a test case.
Fixes: #18584
|
|
|
|
|
|
| |
The OLD behaviors of all policies are deprecated, but only by
documentation. Add an explicit deprecation diagnostic for some policies
to encourage projects to port away from setting policies to OLD.
|
|
|
|
|
|
| |
On filesystems with 1s resolution the `run_sub_cmake` cases fail
occasionally when the 1 second sleep does not cause files to have
a different time. Use 3 seconds instead.
|
|
|
|
|
|
| |
See-also: https://issues.slicer.org/view.php?id=4595
Reported-by: Isaiah Norton <inorton@bwh.harvard.edu>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Since commit v3.9.0-rc1~230^2~2 (ninja: break unnecessary target
dependencies, 2017-04-17) we unconditionally generate a phony edge for
target ordering. It is needed in case a later target depends on it.
However, if the phony edge has no inputs then `ninja -d explain` prints:
ninja explain: output ... of phony edge with no inputs doesn't exist
Furthermore the phony edge's output is considered dirty and can cause
dependents to be incorrectly considered dirty. Avoid this by always
generating at least one input to the target ordering phony edges.
If we have no real dependencies just use a path that always exists.
Fixes: #17942
|
|
|
|
|
|
|
|
|
|
| |
The Ninja generator splits preprocessing and compilation steps for
Fortran. Fix this logic to work when using response files for
compilation so that it works for the preprocessing step too.
This fixes behavior under `CMAKE_NINJA_FORCE_RESPONSE_FILE`.
Issue: #17877
|
|
|
|
|
|
|
|
|
|
|
| |
Put commands that contain `||` into brackets to avoid early abort of
execution by `cmd.exe` because `||` has higher precedence than `&&` in
`cmd.exe`.
Add test to check for command execution after `||` as part of a
parameter and as command separator.
Fixes: #16850
|
|
|
|
|
| |
This is a dark corner of the Ninja generator. It should be fixed in the
future, but add a test which shows its behaviors.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, given two libraries, X and Y where X depends on Y, all
object compilations of X would require the Y library to have been linked
before being compiled. This is not necessary and can instead be loosened
such that object compilations of X only depend on the order-only
dependencies of Y to be completed. This is to ensure that generated
sources, headers, custom commands, etc. are completed before X starts to
compile its objects.
This should help build performance in projects with many libraries which
cause a deep library dependency chain. Previously, a library at the
bottom would not start compilation until after all other libraries
completed, but now only its link step needs to wait and its compilation
jobs can be run in parallel with other tasks.
Fixes: #15555
|
| |
|
|
|
|
|
|
|
|
|
|
| |
The targets added by commit v3.6.0-rc1~240^2~2 (Ninja: Add `$subdir/all`
targets, 2016-03-11) use as `$subdir` the relative path from the top of
the source tree to the current source directory. This is not correct
when using `add_subdirectory(test test_bin)`. Instead we need to use
the relative path from the top of the binary tree to the current binary
directory as was done for related targets by commit v3.7.0-rc1~268^2
(Ninja: Add `$subdir/{test,install,package}` targets, 2016-08-05).
|
|
|
|
|
|
|
|
| |
Diagnose failure to run `ninja --version` and abort early. Otherwise we
end up aborting with a confusing message about ninja version "" being
too old.
Closes: #16378
|
|
|
|
|
|
|
|
| |
Provide a way for custom commands to inform the ninja build tool about
their implicit dependencies. For now simply make use of the option an
error on other generators.
Closes: #15479
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With the Makefile generator one can use `cd $subdir; make install` to build and
install targets associated with a given subdirectory. This is not possible to
do with the Ninja generator since there is only one `build.ninja` file at the
top of the build tree. However, we can approximate it by allowing one to run
`ninja $subdir/install` at the top of the tree to build the targets in the
corresponding subdirectory and install them.
This also makes sense for `test`, `package`, and other GLOBAL_TARGET targets.
It was already done for `all` by commit v3.6.0-rc1~240^2~2 (Ninja: Add
`$subdir/all` targets, 2016-03-11).
|
|
|
|
|
| |
Some test cases need features not available in Ninja < 1.6, so check the
version before running them.
|
|
|
|
|
|
| |
Add a `CMAKE_NINJA_OUTPUT_PATH_PREFIX` variable. When it is set, CMake
generates a `build.ninja` file suitable for embedding into another ninja
project potentially generated by an alien generator.
|
| |
|