| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
| |
Passing cmListFileFunction everywhere by-value involves big overhead.
Now cmListFileFunction stores std::shared_ptr to the underlying data.
|
|
|
|
|
|
|
|
|
|
|
| |
The only call sites that pass the explicit file name argument are in
function blocker `ArgumentsMatch` methods for `function` and `macro`.
We already ensure that they are balanced within a file scope, and the
RAII helpers `BuildsystemFileScope` and `ListFileScope` ensure that the
backtrace and execution list file stacks unwind to the matching level.
Therefore we can assume that the file name where we are checking for
matching arguments matches starting file name where those arguments
first appeared, and do not need to pass it explicitly.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`CMAKE_CURRENT_FUNCTION`
Can be used for diagnostic or debugging messages like the
`__PRETTY_FUNCTION__` macro of GCC.
`CMAKE_CURRENT_FUNCTION_LIST_DIR`
Eliminates the necessity of the additional "global"
variables inside a module used to access additional "resource"
files from functions defined in the module.
...
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Provide a standardized way to handle the C++ "standard" headers
customized to be used with current CMake C++ standard constraints.
Offer under directory `cm` headers which can be used as direct
replacements of the standard ones. For example:
#include <cm/string_view>
can be used safely for CMake development in place of the `<string_view>`
standard header.
Fixes: #19491
|
|
|
|
|
|
| |
Set the MinTypeNameLength option to an impossibly high value in order
to limit the diagnostics to iterators. Leave new expressions and cast
expressions for later.
|
|
|
|
|
|
|
| |
This replaces `std::ostringstream`, when it is written to only once.
If the single written argument was numeric, `std::to_string` is used instead.
Otherwise, the single written argument is used directly instead of the
`std::ostringstream::str()` invocation.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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)`
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
This adds the `cmStringAlgorithms.h` header and moves all string functions
from `cmAlgorithms.h` to `cmStringAlgorithms.h`.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This changes `cmMakefile::AddDefinition` to take a `cm::string_view` as value
argument instead of a `const char *`.
Benefits are:
- `std::string` can be passed to `cmMakefile::AddDefinition` directly without
the `c_str()` plus string length recomputation fallback.
- Lengths of literals passed to `cmMakefile::AddDefinition` can be computed at
compile time.
In various sources uses of `cmMakefile::AddDefinition` are adapted to avoid
`std::string::c_str` calls and the `std::string` is passed directly.
Uses of `cmMakefile::AddDefinition`, where a `nullptr` `const char*` might
be passed to `cmMakefile::AddDefinition` are extended with `nullptr` checks.
|
| |
|
|
|
|
|
|
|
|
|
| |
Replace the members for the Makefile and the Error with a
cmExecutionStatus. Re-implement GetMakefile and SetError based on that.
Both functions should be called directly on the cmExecutionStatus that is
passed to InitialPass. This will help us make all Commands immutable and
remove the need for cloning.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
Suppress some cases in `Source/cmGeneratorExpressionNode.cxx` and
`Source/cmUVHandlePtr.h` where a few older compilers require a
user-defined default constructor (with `{}`).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
We now require C++11 support including `override`. Drop use of
the old compatibility macro. Convert references as follows:
git grep -l CM_OVERRIDE -- '*.h' '*.hxx' '*.cxx' |
xargs sed -i 's/CM_OVERRIDE/override/g'
|
|
|
|
|
|
| |
Changes done via `clang-tidy` with some manual fine-tuning
for the variable naming and `auto` type deduction
where appropriate.
|
| |
|
| |
|
|\
| |
| |
| |
| |
| |
| |
| |
| | |
fdd341eb cmFindCommon: remove unused function SetMakefile
67a8d907 cmExecutionStatus: Remove arguments from setters
0c519c70 bootstrap: Remove leftovers from cmBootstrapCommands
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !821
|
| |
| |
| |
| |
| | |
The setters are only used to set boolean values. The values are never
reset individually.
|
|/ |
|
| |
|
| |
|
|\
| |
| |
| |
| |
| |
| |
| |
| | |
2214011f Make cmCPackGenerator not inherit from cmObject
7f9a8d53 Make cmCPackGeneratorFactory not inherit from cmObject
fb0b087c Make cmCTestGenericHandler not inherit from cmObject
2169b0fa Make cmCPackLog not inherit from cmObject
9855ebf1 Make cmCommand not inherit from cmObject
|
| | |
|
|/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Since commit 14a8d61f (cmMakefile: Port nested error logic away from
cmExecutionStatus) we fail to continue processing function and macro
bodies after non-fatal errors. A non-fatal error should not stop
foreach loops, macro bodies, nested bodies, or the outer script.
Add a test covering these cases, and revert the change to fix them.
Also revert commit 2af853de (cmMakefile: Simplify IssueMessage
implementation) because the assertion it added (which was removed by the
above commit and is restored by reverting it) is incorrect. We do have
code paths that call cmMakefile::IssueMessage with an empty execution
stack, such as in CheckForUnusedVariables's LogUnused call.
|
|
|
|
| |
It is no longer needed.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
Extend snapshot creation API to store the file being executed and the
entry point to get to that context.
|
|
|
|
| |
It is now unused.
|