| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
Add block() and endblock() commands offering the capability to create
new scopes for variables and/or policies.
Fixes: #20171
|
|
|
|
|
|
|
|
| |
Rename the booleans 's_ErrorOccured' and 's_FatalErrorOccured' to
's_ErrorOccurred' and 's_FatalErrorOccurred', respectively.
Rename the getters and setters to 'Get[Fatal]ErrorOccurred' and
'Set[Fatal]ErrorOccurred', and fix all uses across the codebase.
|
| |
|
|
|
|
|
|
|
| |
This presents value semantics for a stack of constant values.
Internally it shares ownership to avoid copies. Previously
this was implemented by `cmListFileBacktrace` explicitly,
but the approach can be re-used for other kinds of stacks.
|
|
|
|
|
| |
This removes the last part of the `cmListFileBacktrace` interface
that needs to know the type of data in its stack.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
After !6954 got merged, it has become easier for tools to get
full stack-traces for runtime traces of a CMake program. The trace
information already included in the JSON objects (line number, source
file path) allows tools that display these stack traces to print the
CMake source code associated to them. However, CMake commands may
spawn multiple lines, and the JSON information associated to a trace
only contains the line in which the command started, but not the one
in which it ended. If tools want to print stack traces along the
relevant source code, and they want to print the whole command
associated to the stack frame, they will have to implement their own
CMake language parser to know where the command ends.
In order to simplify the life of those who want to write tooling for
CMake, this commit adds a `line_end` field to the json-v1 trace
format. If a given command spans multiple lines, the `line_end` field
will contain the line of the last line spanned by the command (that of
the closing parenthesis associated to the command).
|
| |
|
|
|
|
| |
Accept a `cmListFileFunction` instead of a `cmCommandContext`.
|
| |
|
|
|
|
|
| |
All uses of `GetBottom` by clients have been removed, so drop the
method and its supporting infrastructure.
|
|
|
|
|
|
| |
Move backtrace printing functions from `cmListFileBacktrace` over to
`cmMessenger`, their primary caller. Thread `cmMessenger` instances
through APIs needed to update other call sites.
|
|
|
|
|
| |
Construct with the project kind instead of mutating state after
construction.
|
|
|
|
|
|
|
|
| |
Printing paths to CMake input files does not need to use the
generator-wide relative path conversion rules because we are not
actually generating a relative path for the build system that needs to
be consistent with anything else. Instead, simply print a relative path
if it does not need to start in `../`, and otherwise an absolute path.
|
|
|
|
| |
The "Not" in the method name is backward from its logic.
|
|
|
|
| |
Pass a Windows extended path to the lexer so it can open long paths.
|
| |
|
|
|
|
|
| |
CMake uses explicit 'this->' style. Using custom clang-tidy check we can
detect and fix places where 'this->' was missed.
|
|
|
|
| |
Fixes: #19153
|
|
|
|
|
| |
Passing cmListFileFunction everywhere by-value involves big overhead.
Now cmListFileFunction stores std::shared_ptr to the underlying data.
|
|
|
|
| |
Fixes: #19575
|
| |
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
| |
Fix diagnostics that appear on macOS with clang-tidy-8. Suppress cases
where we intentionally take an argument by value to let the caller
choose whether to copy or move.
|
|
|
|
|
|
|
|
|
|
|
|
| |
This replaces the code pattern
```
std::vector<std::string> args;
cmExpandList(valueStr, args, ...)
```
with
```
std::vector<std::string> args = cmExpandedList(valueStr, ...)
```
|
| |
|
|
|
|
| |
Fixes: #19301
|
|
|
|
|
|
| |
They are unused, but if someone used them they would lead to
problems since they would copy the internal raw pointers
and the destructor would cause double delete
|
|\
| |
| |
| |
| |
| |
| | |
b6a957c969 cmOutputConverter: move ConvertToRelativePath to cmStateDirectory.
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2831
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
We use a comma-in-paren expression to evaluate multiple statements
in a condition. Clang warns that this may be incorrect. Follow
its suggestion to cast all but the last expression to `void` to
silence the warning.
|
|/ |
|
|
|
|
| |
Reduce the number of files relying on `cmake.h`.
|
|
|
|
| |
Accept const std::string& arguments only
|
| |
|
| |
|
|
|
|
|
| |
We can only get the top of a stack that has at least one call.
Update the method's comment accordingly.
|
|
|
|
|
|
|
|
| |
Replace use of raw pointers and explicit reference counting with
`std::shared_ptr<>`. Use a discriminated union to store either the
bottom level or a call/file context in each heap-allocated entry.
This avoids storing a copy of the bottom in every `cmListFileBacktrace`
instance and shrinks the structure to a single `shared_ptr`.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Store both the as-written and lower-case command names and use
the latter to avoid case-insensitive string comparisons.
With this I obtain 2-6% speed increase (on Windows) for the configure
step with no significant changes in memory usage. A case-insensitive
comparison is a lot slower than just calling `==` because the operator
will use things like memcmp, so prefer the latter.
The `cmSystemTools::LowerCase` function allocates a new string each time
it is called, so before this change we were allocating in:
* cmMakefile::Configure two times for each function
(to look for `cmake_minimum_required` and `project`)
* cmMakefile::ExecuteCommand twice by function by calling
cmState::GetCommand and copying the name
Now we are only allocating once by function instead of four.
|
|
|
|
|
| |
- Use `std::move` while inserting temporary results into vectors.
- Change `push_back` to `emplace_back` where appropriate.
|
| |
|
|
|
|
| |
Also remove `#include "cmConfigure.h"` from most source 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'
|
|
|
|
|
|
|
| |
If we are given a FIFO, for example, we cannot seek back after trying to
read a Byte-Order-Mark.
Closes: #16607
|
|
|
|
|
| |
Include it in dependents which have previously relied on it
transitively.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|