diff --git a/gtsam.h b/gtsam.h index 97eb2d8c3..826f8472e 100644 --- a/gtsam.h +++ b/gtsam.h @@ -248,6 +248,9 @@ class FactorIndices { /** gtsam namespace functions */ +#include +bool isDebugVersion(); + #include class IndexPair { IndexPair(); diff --git a/gtsam/base/debug.cpp b/gtsam/base/debug.cpp index 1c4d08dcd..d6d2a4fe0 100644 --- a/gtsam/base/debug.cpp +++ b/gtsam/base/debug.cpp @@ -47,4 +47,15 @@ void guardedSetDebug(const std::string& s, const bool v) { gtsam::debugFlags[s] = v; } +bool isDebugVersion() { +#ifdef NDEBUG + // nondebug + return false; +#else + // debug + return true; +#endif + +} + } diff --git a/gtsam/base/debug.h b/gtsam/base/debug.h index e21efcc83..7fa943503 100644 --- a/gtsam/base/debug.h +++ b/gtsam/base/debug.h @@ -47,6 +47,7 @@ namespace gtsam { // Non-guarded use led to crashes, and solved in commit cd35db2 bool GTSAM_EXPORT guardedIsDebug(const std::string& s); void GTSAM_EXPORT guardedSetDebug(const std::string& s, const bool v); + bool GTSAM_EXPORT isDebugVersion(); } #undef ISDEBUG