File tree Expand file tree Collapse file tree 2 files changed +40
-32
lines changed Expand file tree Collapse file tree 2 files changed +40
-32
lines changed Original file line number Diff line number Diff line change 1+ # -------------------------------------------------------------------------------------------------------------- #
2+ # Debug utilities functions
3+ # -------------------------------------------------------------------------------------------------------------- #
4+
5+ include_guard (GLOBAL )
6+
7+ # Debug
8+ message (VERBOSE "rsp/debug module included" )
9+
10+ if (NOT COMMAND "dump" )
11+
12+ #! dump : Outputs given variables' name and value
13+ #
14+ # @param ... Variables to output
15+ #
16+ function (dump)
17+ foreach (var ${ARGN} )
18+ message ("${var} = ${${var} }" )
19+ endforeach ()
20+
21+ # Output as warning so that the developer is able to see call stack!
22+ message (WARNING " ${CMAKE_CURRENT_FUNCTION} () called from ${CMAKE_CURRENT_LIST_FILE} " )
23+ endfunction ()
24+ endif ()
25+
26+ if (NOT COMMAND "dd" )
27+
28+ #! dump and die: Outputs given variables' name and value and stops build
29+ #
30+ # @param ... Variables to output
31+ #
32+ function (dd)
33+ foreach (var ${ARGN} )
34+ message ("${var} = ${${var} }" )
35+ endforeach ()
36+
37+ # Output as fatal error to ensure that build stops.
38+ message (FATAL_ERROR " ${CMAKE_CURRENT_FUNCTION} () called from ${CMAKE_CURRENT_LIST_FILE} " )
39+ endfunction ()
40+ endif ()
Original file line number Diff line number Diff line change @@ -120,35 +120,3 @@ if (NOT COMMAND "safeguard_properties")
120120 endforeach ()
121121 endfunction ()
122122endif ()
123-
124- if (NOT COMMAND "dump" )
125-
126- #! dump : Outputs given variables' name and value
127- #
128- # @param ... Variables to output
129- #
130- function (dump)
131- foreach (var ${ARGN} )
132- message ("${var} = ${${var} }" )
133- endforeach ()
134-
135- # Output as warning so that the developer is able to see call stack!
136- message (WARNING " ${CMAKE_CURRENT_FUNCTION} () called from ${CMAKE_CURRENT_LIST_FILE} " )
137- endfunction ()
138- endif ()
139-
140- if (NOT COMMAND "dd" )
141-
142- #! dump and die: Outputs given variables' name and value and stops build
143- #
144- # @param ... Variables to output
145- #
146- function (dd)
147- foreach (var ${ARGN} )
148- message ("${var} = ${${var} }" )
149- endforeach ()
150-
151- # Output as fatal error to ensure that build stops.
152- message (FATAL_ERROR " ${CMAKE_CURRENT_FUNCTION} () called from ${CMAKE_CURRENT_LIST_FILE} " )
153- endfunction ()
154- endif ()
You can’t perform that action at this time.
0 commit comments