Files
cmake/Tests/RunCMake/DiagnosticScope/Block.cmake
T
Matthew Woehlke a0612aeb5d Diagnostics: Add cmake_diagnostic command
Add command to manipulate the new diagnostic stack/state introduced in
the previous commit. Start adding documentation for the system as a
whole.
2026-03-19 11:29:44 -04:00

23 lines
561 B
CMake

cmake_diagnostic(SET CMD_AUTHOR IGNORE)
cmake_diagnostic(GET CMD_AUTHOR action)
if(NOT "${action}" STREQUAL "IGNORE")
message(SEND_ERROR "failed to set diagnostic state")
endif()
block(SCOPE_FOR DIAGNOSTICS)
cmake_diagnostic(SET CMD_AUTHOR SEND_ERROR)
cmake_diagnostic(GET CMD_AUTHOR action)
if(NOT "${action}" STREQUAL "SEND_ERROR")
message(SEND_ERROR "failed to set diagnostic state")
endif()
endblock()
cmake_diagnostic(GET CMD_AUTHOR action)
if(NOT "${action}" STREQUAL "IGNORE")
message(SEND_ERROR "failed to restore diagnostic state")
endif()