I create a C-library and compile it using the tools in LibraryLink. When I create a code binary like this
CreateLibrary[src, "lib_name", "Debug" -> True]
I can specify the option "Debug" -> True
or False
. Is it possible to check the value of this option inside the C-code? I just want to add debug information if the library is compiled with Debug option and not use it if this option is not present. For example
//c-code
int is_debug(){
#ifdef DEBUG_MODE
return 1; //when Debug -> True
#else
return 0; //when Debug -> False
#endif
}
//rest code
$CCompiler
. UsuallyNDEBUG
orDEBUG
is a good bet. $\endgroup$DEBUG
andNDEBUG
$\endgroup$