summaryrefslogtreecommitdiff
path: root/src/PlatformUtils.cc
diff options
context:
space:
mode:
authorDon Bright <hugh.m.bright@gmail.com>2013-09-19 01:55:27 (GMT)
committerDon Bright <hugh.m.bright@gmail.com>2013-09-19 01:55:27 (GMT)
commite6f3bd4777ad0c106688693945daeb76757c8988 (patch)
tree81d5c14eb4fb89cad0eff4ba16291968444eddfd /src/PlatformUtils.cc
parent9a484d717083ca2a7c975aad91d452be8a8d6c56 (diff)
enable --info output of names of CGAL Kernels to aid debugging
Diffstat (limited to 'src/PlatformUtils.cc')
-rw-r--r--src/PlatformUtils.cc30
1 files changed, 27 insertions, 3 deletions
diff --git a/src/PlatformUtils.cc b/src/PlatformUtils.cc
index ccc2bc0..28bd51c 100644
--- a/src/PlatformUtils.cc
+++ b/src/PlatformUtils.cc
@@ -40,8 +40,19 @@ std::string PlatformUtils::libraryPath()
}
#include "version_check.h"
+#include "cgal.h"
+#include <boost/algorithm/string.hpp>
#define STRINGIFY(x) #x
#define TOSTRING(x) STRINGIFY(x)
+
+#if defined(__GNUG__)
+#define GCC_INT_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 )
+#if GCC_INT_VERSION > 40700 || defined(__clang__)
+#include <cxxabi.h>
+#define __openscad_info_demangle__ 1
+#endif // GCC_INT_VERSION
+#endif // GNUG
+
std::string PlatformUtils::info()
{
std::stringstream s;
@@ -68,16 +79,29 @@ std::string PlatformUtils::info()
#define OPENCSG_VERSION_STRING "unknown, <1.3.2"
#endif
+ std::string cgal_3d_kernel = typeid(CGAL_Kernel3).name();
+ std::string cgal_2d_kernel = typeid(CGAL_Kernel2).name();
+ std::string cgal_2d_kernelEx = typeid(CGAL_ExactKernel2).name();
+#if defined(__openscad_info_demangle__)
+ int status;
+ cgal_3d_kernel = std::string( abi::__cxa_demangle( cgal_3d_kernel.c_str(), 0, 0, &status ) );
+ cgal_2d_kernel = std::string( abi::__cxa_demangle( cgal_2d_kernel.c_str(), 0, 0, &status ) );
+ cgal_2d_kernelEx = std::string( abi::__cxa_demangle( cgal_2d_kernelEx.c_str(), 0, 0, &status ) );
+#endif
+ boost::replace_all( cgal_3d_kernel, "CGAL::", "" );
+ boost::replace_all( cgal_2d_kernel, "CGAL::", "" );
+ boost::replace_all( cgal_2d_kernelEx, "CGAL::", "" );
+
s << "OpenSCAD Version: " << TOSTRING(OPENSCAD_VERSION)
<< "\nCompiler: " << compiler_info
<< "\nCompile date: " << __DATE__
<< "\nBoost version: " << BOOST_LIB_VERSION
<< "\nEigen version: " << EIGEN_WORLD_VERSION << "." << EIGEN_MAJOR_VERSION << "." << EIGEN_MINOR_VERSION
- << "\nCGAL version: " << TOSTRING(CGAL_VERSION)
+ << "\nCGAL version, kernels: " << TOSTRING(CGAL_VERSION) << ", " << cgal_3d_kernel << ", " << cgal_2d_kernel << ", " << cgal_2d_kernelEx
<< "\nOpenCSG version: " << OPENCSG_VERSION_STRING
<< "\nQt version: " << qVersion()
- << "\nMingW build: " << mingwstatus;
-
+ << "\nMingW build: " << mingwstatus
+ ;
return s.str();
}
contact: Jan Huwald // Impressum