[ci skip] Added free function to check if compiled library is debug version or not
parent
2071aa7556
commit
162d748dd1
3
gtsam.h
3
gtsam.h
|
@ -248,6 +248,9 @@ class FactorIndices {
|
||||||
|
|
||||||
/** gtsam namespace functions */
|
/** gtsam namespace functions */
|
||||||
|
|
||||||
|
#include <gtsam/base/debug.h>
|
||||||
|
bool isDebugVersion();
|
||||||
|
|
||||||
#include <gtsam/base/DSFMap.h>
|
#include <gtsam/base/DSFMap.h>
|
||||||
class IndexPair {
|
class IndexPair {
|
||||||
IndexPair();
|
IndexPair();
|
||||||
|
|
|
@ -47,4 +47,15 @@ void guardedSetDebug(const std::string& s, const bool v) {
|
||||||
gtsam::debugFlags[s] = v;
|
gtsam::debugFlags[s] = v;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool isDebugVersion() {
|
||||||
|
#ifdef NDEBUG
|
||||||
|
// nondebug
|
||||||
|
return false;
|
||||||
|
#else
|
||||||
|
// debug
|
||||||
|
return true;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,6 +47,7 @@ namespace gtsam {
|
||||||
// Non-guarded use led to crashes, and solved in commit cd35db2
|
// Non-guarded use led to crashes, and solved in commit cd35db2
|
||||||
bool GTSAM_EXPORT guardedIsDebug(const std::string& s);
|
bool GTSAM_EXPORT guardedIsDebug(const std::string& s);
|
||||||
void GTSAM_EXPORT guardedSetDebug(const std::string& s, const bool v);
|
void GTSAM_EXPORT guardedSetDebug(const std::string& s, const bool v);
|
||||||
|
bool GTSAM_EXPORT isDebugVersion();
|
||||||
}
|
}
|
||||||
|
|
||||||
#undef ISDEBUG
|
#undef ISDEBUG
|
||||||
|
|
Loading…
Reference in New Issue