| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
For policy-specific tests, use the version before the policy was
introduced. Otherwise, use 3.5 where possible.
Also, remove `cmake_minimum_required()` and `project()` calls from
individual cases where they are handled by `CMakeLists.txt`.
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
| |
With arguments list expanded.
|
|
|
|
|
| |
When `conditionEvaluator.IsTrue(...)` returns `false` it just
didn't print the error occured.
|
|
|
|
|
|
|
|
| |
As reported in the BUG #22524, mismatched parenthesis reported differently
for `while()` and `if()`.
The problem was in the double loop (over "handlers" and the arguments),
where the outer loop didn't check the result of the running handler.
|
|
|
|
| |
Fixes: #19153
|
|
|
|
| |
Use 3.3 or 2.8.12 where possible.
|
|
|
|
| |
with the error messages of endforeach, endmacro, endfunction, etc.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Since commit v3.4.0-rc1~321^2~2 (Genex: Store a backtrace, not a pointer
to one, 2015-07-08) we treat cmListFileBacktrace instances as
lightweight values. This was true at the time only because the
backtrace information was kept in the cmState snapshot hierarchy.
However, that forced us to accumulate a lot of otherwise short-lived
snapshots just to have the backtrace fields available for reference by
cmListFileBacktrace instances. Recent refactoring made backtrace
instances independent of the snapshot hierarchy to avoid accumulating
short-lived snapshots. This came at the cost of making backtrace values
heavy again, leading to lots of string coying and slower execution.
Fix this by refactoring cmListFileBacktrace to provide value semantics
with efficient shared storage underneath. Teach cmMakefile to maintain
its call stack using an instance of cmListFileBacktrace. This approach
allows the current backtrace to be efficiently saved whenever it is
needed.
Also teach cmListFileBacktrace the notion of a file-level scope. This
is useful for messages about the whole file (e.g. during parsing) that
are not specific to any line within it. Push the CMakeLists.txt scope
for each directory and never pop it. This ensures that we always have
some context information and simplifies cmMakefile::IssueMessage.
Push/pop a file-level scope as each included file is processed. This
supersedes cmParseFileScope and improves diagnostic message context
information in a few places. Fix the corresponding test cases to expect
the improved output.
|
|
Move failure cases from the CMake.{If,List,While,GetProperty} tests over
to the RunCMake.{if,list,while,get_property} tests to use the more
modern infrastructure. This also avoids using REGEX_ESCAPE_STRING to
try to regex-match full paths.
|