| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Fixes: #23871
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
Add a policy to diagnose condition errors in a compatible way.
Fixes: #23296
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Since commit 880ca66b51 (Fix: `while()` can silently ignore incorrect
condition, 2021-08-09, v3.22.0-rc1~238^2~4) we correctly reject the
code
set(paren "(")
while(${paren})
endwhile()
However, rejecting it breaks compatibility with projects that used such
code accidentally. In CMake 3.21 and below, any error in the condition
was ignored because the `false` result exited the loop first. Restore
tolerance of the error for now. A policy will be needed to make it an
error later.
Note that the same condition with `if` was always correctly rejected.
Fixes: #22524
Issue: #23296
Co-authored-by: Brad King <brad.king@kitware.com>
|
| |
|
|
|
|
| |
Particularly `Args`.
|
|
|
|
| |
And reduce scope for some variables + use some more `auto`.
|
|
|
|
| |
With arguments list expanded.
|
|
|
|
|
| |
When `conditionEvaluator.IsTrue(...)` returns `false` it just
didn't print the error occured.
|
|
|
|
|
| |
Passing cmListFileFunction everywhere by-value involves big overhead.
Now cmListFileFunction stores std::shared_ptr to the underlying data.
|
|
|
|
|
|
| |
The execution context passed to the constructor always matches the top
of the backtrace, so the former can be removed in favor of using only
the latter.
|
|
|
|
|
|
|
|
|
|
|
| |
Evaluation of the `elseif`, `else`, and `while` commands takes place
during function blocker evaluation before any actual command execution
takes place. Therefore they do not have an entry in the backtrace
stack. Each of their implementations needs to construct an extra
backtrace entry to use in error messages and such. Each of them used a
slightly different approach due to evolution over time. Clean up their
construction of the extra backtrace entry and use a named variable to
contain it for clarity.
|
| |
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Reduce the number of files relying on `cmake.h`.
|
|
|
|
|
| |
Fix some warnings that are new since clang-tidy version 4, and update
`.clang-tidy` to suppress the rest.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Signed-off-by: Matthias Maennich <matthias@maennich.net>
|
|
|
|
|
|
| |
Changes done via `clang-tidy` with some manual fine-tuning
for the variable naming and `auto` type deduction
where appropriate.
|
|
|
|
|
| |
The setters are only used to set boolean values. The values are never
reset individually.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Replace use of cmsys::auto_ptr with a CM_AUTO_PTR macro that maps to
our own implementation adopted from the KWSys auto_ptr implementation.
Later we may be able to map CM_AUTO_PTR to std::auto_ptr on compilers
that do not warn about it.
Automate the client site conversions:
git grep -l auto_ptr -- Source/ | grep -v Source/kwsys/ | xargs sed -i \
's|cmsys::auto_ptr|CM_AUTO_PTR|;s|cmsys/auto_ptr.hxx|cm_auto_ptr.hxx|'
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Each source file has a logical first include file. Include it in an
isolated block so that tools that sort includes do not move them.
|
| |
|
|
|
|
|
| |
All it does is call cmListFileContext::FromCommandContext, so move this
to the call sites.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Commit v3.4.0-rc1~494^2~4 (cmMakefile: Add API for elseif to create
backtrace., 2015-05-29) removed the use of cmMakefileCall to push/pop
execution context in favor of a new way to create backtraces.
However, a call to cmMakefile::GetExecutionContext is still invoked to
issue a contextual CMP0054 warning through cmConditionEvaluator. As
the elseif is not part of the call stack, this resulted in trying to
access an empty vector.
Avoid the attempt at getting execution context when evaluating elseif by
constructing a context and backtrace on behalf of the cmConditionEvaluator
in all cases.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The fix in commit v3.2.3~3^2 (Fix assertion failure on unmatched foreach
in function, 2015-05-18) broke handling of unmatched non-loop blocks
because it assumed all function blockers removed during error unwinding
were for loops, essentially switching the set of mishandled cases.
The purpose of the loop block push/pop operations is to define a scope
matching the lifetime of the loop function blockers. Since our function
blockers already have the proper lifetime, simply move the push/pop
operations to their constructor/destructor.
Extend the RunCMake.Syntax test with a case covering this.
|
| |
|
| |
|
|
|
|
|
| |
Inspired-by: Doug Barbieri
Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It gets incremented while entering a loop block (e.g. foreach or while)
and gets decremented when leaving the block. Because scope borders for
example at function borders must be taken into account the counter is
put into a stack. With every new scope an empty counter is pushed on the
stack, when leaving the scope the original value is restored.
This will allow easy querying if the break command is properly nested
within a loop scope.
Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
|
| |
|
| |
|
|
|
|
|
|
| |
Replace the boolean value that indicates whether an argument is unquoted
or quoted with a generalized enumeration of possible argument types.
For now "Quoted" and "Unquoted" remain the only types.
|