cmakepp_lang/utilities/enable_if_debug
- cmakepp_lang/utilities/enable_if_debug.cpp_enable_if_debug()
Note
This is a macro, and so does not introduce a new scope.
Logic for enabling/disabling code when CMakePP is run in debug mode.
CMakePP supports a “debug mode” which enables potentially computationally expensive logging and error checks. In release mode these operations are skipped so that the build proceeds as fast as possible. The
cpp_enable_if_debug
function will only allow the remainder of the function to run if debug mode has been enable (done by settingCMAKE_CORE_DEBUG_MODE
toTRUE
/ON
).- Variables:
CMAKEPP_LANG_DEBUG_MODE (bool) – Used to determine if CMakePP is being run in debug mode or not.
Warning
This function is a macro in order to allow it to prematurely return from the function that called it. For this reason it is important that
cpp_enable_if_debug
is only called from functions and NOT macros.Error Checking
cpp_enable_if_debug
will raise an error if it is called with any arguments.