mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 13:51:33 -06:00
Tools using the json-v1 format might want to trace stack frames across different `CMakeLists.txt` files, in order to, for example, provide stacktraces that span from the top-level `CMakeLists.txt` in a project. One would think that `frame` lets you do that, but it doesn't, because it tells you the depth of the stack within the current `CMakeLists.txt`, so it gets reset across calls to `add_subdirectory`. The solution involves adding a field with a "global frame". This value gets incremented on calls to `add_subdirectory`, which makes it easier for tools to reconstruct "global stacktraces". I considered changing the current "frame" value, but I didn't because it would be a breaking change. I cannot think of any use-case where "frame" is more useful to "global-frame", but maybe I'm missing something.
7 lines
216 B
CMake
7 lines
216 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)
|