mirror of
https://github.com/Kitware/CMake.git
synced 2025-12-30 18:29:37 -06:00
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
12 lines
260 B
CMake
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()
|