| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
Store the main dependency as the first entry in the dependency list plus
a boolean member indicating its existence. Note that this slightly
changes existing behavior: the main dependency was previously the last
entry of the dependency list.
|
| |
|
|
|
|
| |
Avoid repeating it at every call site.
|
| |
|
|
|
|
|
| |
Issue: #20286
Fixes: #21415
|
|
|
|
|
|
|
|
|
| |
Move rejection of `#`, `<`, and `>` characters in outputs and byproducts
to a generate-time check. This removes the front-end check that
disallowed generator expressions. The generators have already been
updated to handle them.
Fixes: #12877
|
|
|
|
|
|
|
|
|
|
|
| |
If an output or byproduct path starts in a generator expression, do not
convert it to a full path yet. That will have to be done at generate
time after evaluating the generator expressions.
Also update the `add_custom_target` byproduct path conversion added by
commit 445ff5ccdf (Byproducts: collapse full paths of custom target
byproducts, 2019-09-11, v3.16.0-rc1~103^2~1) to match the behavior of
`add_custom_command` when a path starts in a generator expression.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
Since commit 777ceaea94 (cmMakefile: Delay custom command creation,
2019-10-17, v3.17.0-rc1~352^2) we process custom command declarations
at generate time. This includes the append-to-non-existing-command
check, so we do not need it at configure time.
|
|
|
|
| |
And give other generators a path forward to add support in the future.
|
|
|
|
|
|
| |
`CollapseFullPath` calls getcwd, which is a rather expensive system
call. we can replace it with `GetHomeOutputDirectory()` to save us from
the calling overhead
|
| |
|
|
|
|
|
|
|
|
| |
Move custom command creation to cmLocalGenerator and dispatch custom
commands in cmMakefile to generate time. Generators add custom commands
using the new methods provided by cmLocalGenerator.
Issue: #12877
|
|
|
|
| |
The enumerations will also be used in cmLocalGenerator.
|
| |
|
|
|
|
|
| |
Use the output checks for byproducts of add_custom_command also for byproducts
of add_custom_target.
|
| |
|
|
|
|
|
| |
Replace string construction using std::stringstream with cmStrCat and
cmWrap.
|
|\
| |
| |
| |
| |
| |
| |
| | |
5d28e361b7 add_custom_command: Move append functionality into class cmMakefile
4fb29850ad add_custom_command: Refactor setting implicit depends
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3810
|
| | |
|
| |
| |
| |
| |
| | |
Implicit dependencies are now passed as argument to AddCustomCommandToOutput.
This is necessary to be able to delay custom command creation.
|
|/
|
|
|
|
| |
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)`
|
| |
|
|
|
|
| |
Ref: #19499
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
Reduce the number of files relying on `cmake.h`.
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|\
| |
| |
| |
| |
| |
| | |
653b8946 Reduce raw string pointers usage.
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1729
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* 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.
|
| | |
|
|/
|
|
|
|
|
| |
Callgrind indicated that `strlen` was being called a lot of times here
due to the string comparisons. Since keywords are "sparse" in
`add_custom_command`, use a hash comparison to handle keywords and then
use strings for comparison since they have a built-in length parameter.
|
|
|
|
|
| |
- Use `std::move` while inserting temporary results into vectors.
- Change `push_back` to `emplace_back` where appropriate.
|
|
|
|
|
|
| |
Changes done via `clang-tidy` with some manual fine-tuning
for the variable naming and `auto` type deduction
where appropriate.
|
| |
|
| |
|
|
|
|
|
|
| |
This option allows lists generated by generator expressions to be expanded.
Closes: #15935
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Per-source copyright/license notice headers that spell out copyright holder
names and years are hard to maintain and often out-of-date or plain wrong.
Precise contributor information is already maintained automatically by the
version control tool. Ultimately it is the receiver of a file who is
responsible for determining its licensing status, and per-source notices are
merely a convenience. Therefore it is simpler and more accurate for
each source to have a generic notice of the license name and references to
more detailed information on copyright holders and full license terms.
Our `Copyright.txt` file now contains a list of Contributors whose names
appeared source-level copyright notices. It also references version control
history for more precise information. Therefore we no longer need to spell
out the list of Contributors in each source file notice.
Replace CMake per-source copyright/license notice headers with a short
description of the license and links to `Copyright.txt` and online information
available from "https://cmake.org/licensing". The online URL also handles
cases of modules being copied out of our source into other projects, so we
can drop our notices about replacing links with full license text.
Run the `Utilities/Scripts/filter-notices.bash` script to perform the majority
of the replacements mechanically. Manually fix up shebang lines and trailing
newlines in a few files. Manually update the notices in a few files that the
script does not handle.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I otherwise get:
Expected stderr to match:
expect-err> CMake Error at AppendNotOutput.cmake:1 \(add_custom_command\):
expect-err> add_custom_command given APPEND option with output.*
expect-err> which is not already a custom command output.
expect-err> Call Stack \(most recent call first\):
expect-err> CMakeLists.txt:3 \(include\)
Actual stderr:
actual-err> CMake Error at AppendNotOutput.cmake:1 (add_custom_command):
actual-err> add_custom_command given APPEND option with output
actual-err> "/home/stephen/dev/src/cmake/with
actual-err> space/Tests/RunCMake/add_custom_command/AppendNotOutput-build/out" which is
actual-err> not already a custom command output.
actual-err> Call Stack (most recent call first):
actual-err> CMakeLists.txt:3 (include)
Using a specific line for paths is a style already used elsewhere for
the same reason, such as CMP0041 output.
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Run the `Utilities/Scripts/clang-format.bash` script to update
all our C++ code to a new style defined by `.clang-format`.
Use `clang-format` version 3.8.
* If you reached this commit for a line in `git blame`, re-run the blame
operation starting at the parent of this commit to see older history
for the content.
* See the parent commit for instructions to rebase a change across this
style transition commit.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Modern editors provide plenty of ways to visually separate functions.
Drop the explicit comments that previously served this purpose.
Use the following command to automate the change:
$ git ls-files -z -- \
"*.c" "*.cc" "*.cpp" "*.cxx" "*.h" "*.hh" "*.hpp" "*.hxx" |
egrep -z -v "^Source/cmCommandArgumentLexer\." |
egrep -z -v "^Source/cmCommandArgumentParser(\.y|\.cxx|Tokens\.h)" |
egrep -z -v "^Source/cmDependsJavaLexer\." |
egrep -z -v "^Source/cmDependsJavaParser(\.y|\.cxx|Tokens\.h)" |
egrep -z -v "^Source/cmExprLexer\." |
egrep -z -v "^Source/cmExprParser(\.y|\.cxx|Tokens\.h)" |
egrep -z -v "^Source/cmFortranLexer\." |
egrep -z -v "^Source/cmFortranParser(\.y|\.cxx|Tokens\.h)" |
egrep -z -v "^Source/cmListFileLexer\." |
egrep -z -v "^Source/cm_sha2" |
egrep -z -v "^Source/(kwsys|CursesDialog/form)/" |
egrep -z -v "^Utilities/(KW|cm).*/" |
xargs -0 sed -i '/^\(\/\/---*\|\/\*---*\*\/\)$/ {d;}'
This avoids modifying third-party sources and generated sources.
|
| |
|
|
|
|
| |
Match names used in CMake code.
|
|
|
|
| |
All compilers hosting CMake support the std class.
|