Files
CMake/Tests/RunCMake/CommandLine/trace-json-v1.cmake
Braulio Valdivielso Martinez fd46db1745 Trace: process else and elseif commands correctly
There have been two bugs reported about the `else` and `elseif`
commands in the context of the tracing functionality and the json-v1
format (#23191 #22315). In essence, the reported traces referred to
the layer of the stacktrace immediately on top of the expected ones.

This MR fixes both issues. My solution adds a new parameter to the
`PrintCommandTrace` function, `commandMissingFromStack`, that callers
can specify if the command they want to report a trace for is not a
regular part of the stack maintained in `cmMakefile`. This is only the
case for `else` and `elseif`. The other bug is fixed by having the
caller pass a `cmListFileBacktrace`, which helps in getting the right
lines, file names... for the reported command.

Fixes: #23191 #22315
2022-03-25 12:24:38 -04:00

12 lines
260 B
CMake

message(
STATUS
"JSON-V1 str"
"spaces"
)
set(ASDF fff sss " SPACES !!! ")
set(FOO 42)
set(BAR " space in string!")
message(STATUS fff ${ASDF} " ${FOO} ${BAR}" " SPACES !!! ")
add_subdirectory(trace-json-v1-nested)
function_that_uses_else()