| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Internally we mark `file(GENERATE)` outputs as `GENERATED` in order
to tell custom command dependency tracing logic not to expect the
files to exist on disk yet. This is because we do not generate the
files until after that tracing is done.
The Ninja generator also interprets the `GENERATED` property to mean
that it is expected that some build rule will generate the file if
another build rule depends on it. If the generator does not know of a
custom command that generates the file then it adds an empty one so that
the `ninja` build tool does not complain about a dependency on a file
that does not exist and has no rule to generate it. However, this step
is not necessary for `file(GENERATE)` outputs because there is no build
rule to generate them and they will exist before `ninja` runs.
Add an additional `__CMAKE_GENERATED_BY_CMAKE` property internally to
tell the Ninja generator that a `GENERATED` file will exist before the
build starts and is not expected to have a build rule producing it.
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
|
| | |
|
| |
| |
| |
| | |
Clarify that other compile rule generation logic does not depend on it.
|
|\ \
| | |
| | |
| | |
| | |
| | |
| | | |
eaf9f69d41 Fix combined use of compiler launcher with lint tools
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1791
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When using ccache with clang-tidy, ccache needs to wrap compiler
invocation, rather than cmake invocation. But it needs to do it without
affecting the command line that iwyu-like tools are receiving.
With this fix, if __run_co_compile is used, compile launcher is passed
using the new --launcher option, but if __run_co_compile is not needed,
compiler launcher is prepended to the command line as before.
To better illustrate the change: with this fix if running clang-tidy
with CXX_COMPILER_LAUNCHER set to "/usr/bin/time;-p;ccache" (time -p
added strictly for illustration purposes), the command line changes
from:
/usr/bin/time -p ccache cmake -E __run_co_compile \
--tidy=clang-tidy ... -- g++ ...
to:
cmake -E __run_co_compile \
--launcher="/usr/bin/time;-p;ccache" \
--tidy=clang-tidy ... -- g++ ...
This allows the compiler to be run via the launcher, but leaves tidy
(& friends) invocations unaffected.
Fixes: #16493
|
|/ |
|
|
|
|
|
|
|
|
|
|
| |
* Change some functions to take `std::string` instead of
`const char*` in the following classes: `cmMakeFile`, `cmake`,
`cmCoreTryCompile`, `cmSystemTools`, `cmState`, `cmLocalGenerator`
and a few others.
* Greatly reduce using of `const char*` overloads for
`cmSystemTools::MakeDirectory` and `cmSystemTools::RelativePath`.
* Remove many redundant `c_str()` conversions throughout the code.
|
|
|
|
|
| |
- Use `std::move` while inserting temporary results into vectors.
- Change `push_back` to `emplace_back` where appropriate.
|
|\
| |
| |
| |
| |
| |
| |
| | |
c4dc6485 XL: Enable use of response files for includes and objects
e342e410 Makefile,Ninja: Use tool-specific response file flag for include dirs
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1691
|
| |
| |
| |
| |
| |
| |
| | |
When we use a response file for `-I` flags, not all compilers support
the `@<file>` syntax. Define `CMAKE_<LANG>_RESPONSE_FILE_FLAG` to
specify tool-specific flag, just as we do for linking already via
`CMAKE_<LANG>_RESPONSE_FILE_LINK_FLAG`.
|
| | |
|
|/
|
|
|
|
|
| |
Add the support of per-source property COMPILE_OPTIONS,
including generator expressions support.
Related: #17507
|
|
|
|
| |
Fixes: #17542
|
|
|
|
|
|
| |
This allows users to specify different genex-based compile definitions for each file in a target.
Fixes: #17508
|
|
|
|
|
|
| |
Prepare to add generator expression support to more source properties.
Factor out some duplicated code into a helper to avoid further
duplication.
|
|
|
|
|
|
|
|
|
|
| |
Add a `Fortran_COMPILER_LAUNCHER` target property like those added for C
and CXX by commit v3.4.0-rc1~450^2 (Add options to launch the compiler
through tools like ccache or distcc, 2015-06-04) and CUDA by commit
v3.10.0-rc1~531^2 (CUDA: Add option to run the compiler through launcher
tools, 2017-06-09).
Fixes: #17499
|
|\
| |
| |
| |
| |
| |
| |
| | |
f0489856 Retire std::auto_ptr and its macro CM_AUTO_PTR
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Pavel Solodovnikov <hellyeahdominate@gmail.com>
Merge-request: !1300
|
| |
| |
| |
| | |
Signed-off-by: Matthias Maennich <matthias@maennich.net>
|
|/
|
|
|
|
|
|
|
|
|
| |
Since commit v3.0.0-rc1~448^2 (Ninja: use deps = gcc/msvc feature,
2013-10-18) the value of the `DEP_FILE` binding already includes the
needed quoting to refer to the file. However, that commit forgot to
update one of the `$DEP_FILE` references to not be quoted anymore.
The offending code path currently only affects cmcldeps for RC.
Remove the extra quoting now.
Fixes: #17298
|
| |
|
|\
| |
| |
| |
| |
| |
| | |
3bbe95f5 Clean up iwyu code to not be one big if statement.
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1247
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This commit changes the internal -E__run_iwyu to be -E__run_co_compile. This
is used for co-compile commands. These are tools that want to mirror the
compiler. For each compiler invocation the tool will be invoked first. This
started as a way to implement include what you use (iwyu), but has expanded
to include cpplint, cppcheck and others. Likely there will be more in the
future as well. This commit implements each one in its own function and
provides a way to add additional ones in the future with less work.
|
|/
|
|
|
|
| |
Changes done via `clang-tidy` with some manual fine-tuning
for the variable naming and `auto` type deduction
where appropriate.
|
|
|
|
|
|
| |
Create a `<LANG>_CPPCHECK` target property (initialized by a
`CMAKE_<LANG>_CPPCHECK` variable) to specify a `cppcheck` command line
to be run along with the compiler.
|
|\
| |
| |
| |
| |
| |
| | |
5962db43 Use C++11 nullptr
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1175
|
| | |
|
|/
|
|
|
|
|
|
|
| |
The Ninja generator preprocesses and compiles separately for Fortran.
When compiling, tell gfortran that the source is already preprocessed so
that it will honor the `# <line>` directives when producing diagnostics
messages.
Fixes: #17160
|
|\
| |
| |
| |
| |
| |
| | |
712af07e CUDA: CMAKE_EXPORT_COMPILE_COMMANDS now works with CUDA and Ninja
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1055
|
| |
| |
| |
| | |
Fixes: #17061
|
| |
| |
| |
| |
| |
| |
| | |
Command line argument passed to the internal tool "cmake_ninja_dyndep"
could hit MAX_ARG_STRLEN on Linux for projects with a large code base.
To prevent such problems, a response file was opted for argument transfer
in all cases, not only on Windows.
|
|/
|
|
|
|
|
|
| |
Add a `CUDA_COMPILER_LAUNCHER` target property like those added for C
and CXX by commit v3.4.0-rc1~450^2 (Add options to launch the compiler
through tools like ccache or distcc, 2015-06-04).
Fixes: #16953
|
|
|
|
|
| |
Replace the dedicated and non-portable escaping code with use of our
standard escaping logic.
|
|\
| |
| |
| |
| |
| |
| | |
594d3d6f Ninja: support response file for cmake_ninja_depends on Windows
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !722
|
| |
| |
| |
| |
| |
| |
| | |
The internal tool "cmake_ninja_depends" now supports reading the list of ddi
files from a reponse file to circumvent Windows command line length limits.
Use this response file for dyndep rule on Windows.
|
|\ \
| |/
|/|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
d96e5d9a Tests: use BYPRODUCTS in the CustomCommandWorkingDirectory test
664591ce RunCMake.Ninja: add a test for assumed sources
adf60b28 ninja: break unnecessary target dependencies
01c5bb95 RunCMake.Ninja: support passing arguments when running ninja
7f947b60 ninja: remove duplicate order-only dependencies
e9827eba ninja: describe the intermediate order depends target better
b57b7d8e Ninja: Order Fortran dyndep file generation explicitly
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !430
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| | |
|
| |
| |
| |
| | |
This is only used for compiled objects, so indicate it as such.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Each target's dyndep file generation depends on loading information
generated by the same step in its dependencies. Add an explicit
ordering dependency to ensure the needed information is available.
Without the explicit ordering dependency we were abusing the more
general target ordering rules through the preprocessor rules generating
the `.ddi` files used as input to dyndep file generation.
|
|/
|
|
|
| |
When the target property `CUDA_PTX_COMPILATION` is enabled CUDA OBJECT
libraries will generate ptx files instead of object files.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Automate with:
git grep -l '#include <cm_' -- Source \
| xargs sed -i 's/#include <\(cm_.*\)>/#include "\1"/g'
git grep -l '#include <cmsys/' -- Source \
| xargs sed -i 's/#include <\(cmsys\/.*\)>/#include "\1"/g'
git grep -l '#include <cm[A-Z]' -- Source \
| xargs sed -i 's/#include <\(cm[A-Z].*\)>/#include "\1"/g'
|
|\
| |
| |
| |
| |
| |
| | |
805706b3 Ninja: Fix Fortran `include` dependency on generated file
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !601
|
| |
| |
| |
| |
| |
| |
| |
| | |
Work around upstream ninja issue 1251 by converting include directories
used by our Fortran dependency scanner to the same path format that we
use in preprocessor `-I` flags and in the `build.ninja` manifest.
Fixes: #16722
|
|\ \
| | |
| | |
| | |
| | |
| | |
| | | |
feaea065 CUDA: Disable support for using response files.
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !596
|
| |/ |
|
| |\ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The `WINDOWS_EXPORT_ALL_SYMBOLS` target property exports all symbols
found in object files explicitly given to the linker. However, the
linker may also find additional symbols in dependencies and copy them
into the linked binary (e.g. from `msvcrt.lib`). Provide a way to
export an explicit list of such symbols by adding a `.def` file as a
source file.
Fixes: #16473
|