[ci skip] Added free function to check if compiled library is debug version or not

release/4.3a0
Varun Agrawal 2019-06-12 17:50:51 -04:00
parent 2071aa7556
commit 162d748dd1
3 changed files with 15 additions and 0 deletions

View File

@ -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();

View File

@ -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
}
} }

View File

@ -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