| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Fixes: #21694
|
|
|
|
| |
Co-Author: Brad King <brad.king@kitware.com>
|
| |
|
|
|
|
|
|
| |
The `add_custom_command` and `add_custom_target` commands already do
this for plain output and byproduct paths. Perform the same conversion
for such paths discovered after generator expression evaluation too.
|
|
|
|
|
|
| |
* Use value semantics.
* Normalize paths in a separate loop.
* If CollapseFullPath is used, ConvertToUnixSlashes is unnecessary.
|
|
|
|
|
|
|
|
|
|
| |
This was already done for byproducts by commit a583b7bc17 (Genex:
Evaluate byproduct generator expressions in cmCustomCommandGenerator,
2019-09-11, v3.16.0-rc1~86^2). Like that commit, this does not actually
expose the feature to projects because the front-end commands still
reject generator expressions.
Issue: #12877
|
|
|
|
| |
These will become target-level dependencies.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Some calls to CollapseFullPath that already have an absolute path were
updated by commit 22f38c0d6b (cmake: avoid getcwd in `CollapseFullPath`,
2020-01-14, v3.17.0-rc1~171^2) to pass an arbitrary second argument to
prevent unnecessary `getcwd` calls. Since then, the KWSys
implementation of CollapseFullPath has learned to avoid unnecessary
`getcwd` calls on its own, so we can drop the arbitrary second arguments
to our CollapseFullPath calls.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
This still is broken for dependencies on generated paths where they get
generated to the source directory rather than the build directory
however, but there's no way to determine that is the case.
Fixes: #20194
|
|
|
|
|
|
| |
`CollapseFullPath` calls getcwd, which is a rather expensive system
call. we can replace it with `GetHomeOutputDirectory()` to save us from
the calling overhead
|
|
|
|
|
|
|
| |
This is only done if they are "obviously" paths in that they contain a
directory separator.
Fixes: #17111
|
| |
|
|
|
|
| |
Co-Authored-by: vector-of-bool <vectorofbool@gmail.com>
|
|
|
|
|
| |
Run the `clang-format.bash` script to update our C and C++ code to a new
include order `.clang-format`. Use `clang-format` version 6.0.
|
|
|
|
|
| |
Replace generator expression member variable by stack variable in the
constructor.
|
|
|
|
|
|
|
|
|
|
|
| |
Evaluate and expand generator expressions in byproducts of custom commands.
Note that it is still not possible to use generator expressions in byproducts
of the commands `add_custom_command` and `add_custom_target`. These commands
still reject the input. This is a preparation step for OUTPUT generator
expression support.
Issue: #12877
|
|
|
|
|
|
|
| |
Refactored internals of cmCustomCommandGenerator to make processing of path
lists (evaluation of generator expressions and expansion into a list) available
as AppendPaths utility function to be used for byproduct generator expression
support.
|
|\
| |
| |
| |
| |
| |
| | |
f30523d090 clang-tidy: modernize-deprecated-headers
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3792
|
| | |
|
|/
|
|
|
|
| |
Generator expressions may contain or produce backslashes.
Fixes: #19553
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch is generated by a python script that uses regular expressions to
search for string concatenation patterns of the kind
```
std::string str = <ARG0>;
str += <ARG1>;
str += <ARG2>;
...
```
and replaces them with a single `cmStrCat` call
```
std::string str = cmStrCat(<ARG0>, <ARG1>, <ARG2>, ...);
```
If any `<ARGX>` is itself a concatenated string of the kind
```
a + b + c + ...;
```
then `<ARGX>` is split into multiple arguments for the `cmStrCat` call.
If there's a sequence of literals in the `<ARGX>`, then all literals in the
sequence are concatenated and merged into a single literal argument for
the `cmStrCat` call.
Single character strings are converted to single char arguments for
the `cmStrCat` call.
`std::to_string(...)` wrappings are removed from `cmStrCat` arguments,
because it supports numeric types as well as string types.
`arg.substr(x)` arguments to `cmStrCat` are replaced with
`cm::string_view(arg).substr(x)`
|
| |
|
|\
| |
| |
| |
| |
| |
| | |
bf6f5467a0 Fix allocation in CROSSCOMPILING_EMULATOR evaluation
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3591
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
In commit fec441ec17 (Teach CROSSCOMPILING_EMULATOR to support
arguments, 2019-05-30, v3.15.0-rc1~6^2) the new member
`cmCustomCommandGenerator::EmulatorsWithArguments` was not initialized
to the proper size. Fix this and add a test case covering the crash
that could occur with multiple commands where an emulator appears only
in a later command.
Fixes: #19500
Co-Author: Brad King <brad.king@kitware.com>
|
|/
|
|
|
|
|
|
| |
An old workaround for `std::allocator_traits<>::value_type` lints from
IWYU on `std::vector<>` usage breaks IWYU's handling of `<memory>`.
Convert the workaround to use the same approach we already use for a
workaround of `std::__decay_and_strip<>::::__type` lints. Then update
the `<memory>` inclusions to follow the now-correct IWYU lints.
|
|
|
|
| |
Fixes: #19321
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Since commit v3.13.0-rc1~39^2 (add_custom_{command,target}:
WORKING_DIRECTORY generator expressions, 2018-09-22) the
`WORKING_DIRECTORY` option accepts generator expressions.
Fix support for the case of a leading generator expression
by deferring conversion to an absolute path until after
evaluation of the generator expression.
Fixes: #18543
|
|
|
|
|
|
|
| |
This teaches add_custom_command and add_custom_target WORKING_DIRECTORY
about generator expressions
Fixes: #14089
|
|
|
|
|
|
|
|
|
|
|
| |
Our custom command generation logic assumes that all command lines have
at least `argv0`. In `add_custom_{command,target}` we already check
that at least a `COMMAND` was given, but using `COMMAND_EXPAND_LISTS` in
combination with a generator expression that expands to an empty string
may produce an empty command line. In this case simply add an empty
string as a command to maintain our internal invariant.
Fixes: #17993
|
|
|
|
|
|
|
|
|
|
| |
In commit v3.4.0-rc1~480^2~3 (cmCustomCommandGenerator: Port to
cmOutputConverter, 2015-06-04), cmCustomCommandGenerator's access to the
local generator was removed so it needed to construct its own
cmOutputConverter instance. Access to the local generator was then
restored by commit v3.4.0-rc1~285^2~21 (cmCustomCommandGenerator:
Require cmLocalGenerator in API, 2015-07-25), so now we can use its
cmOutputConverter base class methods directly.
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
| |
Signed-off-by: Matthias Maennich <matthias@maennich.net>
|
|\
| |
| |
| |
| |
| |
| | |
7d509579 Meta: modernize old-fashioned loops to range-based `for`.
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1249
|
| |
| |
| |
| |
| |
| | |
Changes done via `clang-tidy` with some manual fine-tuning
for the variable naming and `auto` type deduction
where appropriate.
|
| |
| |
| |
| | |
For `size_t` we should include `stddef.h`.
|
|/ |
|
|
|
|
| |
Also remove `#include "cmConfigure.h"` from most source files.
|
| |
|
|
|
|
|
| |
Expand generator expressions of DEPENDS in the constructor instead
of on-demand.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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'
|
|
|
|
|
|
| |
This option allows lists generated by generator expressions to be expanded.
Closes: #15935
|
|
|
|
|
|
|
|
|
|
|
|
| |
In commit v3.6.0-rc1~88^2 (CustomCommandGenerator: Add support for
CROSSCOMPILING_EMULATOR, 2016-05-04) logic was introduced to substitute
a target's `CROSSCOMPILING_EMULATOR` for argv0 in a custom command.
However, it broke the case when the argv0 was a target name and now
fails to expand the target name to its location at the same time as
inserting the emulator. Fix the latter case.
Inspired-by: Brian Maher <brian@brimworks.com>
Closes: #16288
|