28#include <boost/version.hpp>
43#include <Standard_Version.hxx>
45#include <ngspice/sharedspice.h>
50#define INCLUDE_KICAD_VERSION
51#include <kicad_build_version.h>
52#undef INCLUDE_KICAD_VERSION
59void SetOpenGLInfo(
const char* aVendor,
const char* aRenderer,
const char* aVersion )
69 wxPlatformInfo platform;
70 return platform.GetBitnessName();
76 return !!KICAD_IS_NIGHTLY;
82 wxString msg = wxString::Format( wxT(
"%s" ), wxT( KICAD_VERSION_FULL ) );
89 wxString msg = wxString::Format( wxT(
"%s" ), wxT( KICAD_VERSION ) );
96 wxString msg = wxString::Format( wxT(
"%s %s" ), wxT( __DATE__ ), wxT( __TIME__ ) );
103 wxString msg = wxString::Format( wxT(
"%s" ), wxT( KICAD_SEMANTIC_VERSION ) );
110 wxString msg = wxString::Format( wxT(
"%s" ), wxT( KICAD_MAJOR_MINOR_VERSION ) );
117 wxString msg = wxString::Format( wxT(
"%s" ), wxT( KICAD_COMMIT_HASH ) );
124 wxString msg = wxString::Format( wxT(
"%s" ), wxT( KICAD_MAJOR_MINOR_PATCH_VERSION ) );
130 static std::tuple<int, int, int> retval = KICAD_MAJOR_MINOR_PATCH_TUPLE;
141 wxString eol = aHtml ?
"<br>" :
"\n";
144 wxString indent4 = aHtml ?
" " :
"\t";
146#define ON "ON" << eol
147#define OFF "OFF" << eol
159 wxPlatformInfo platform;
160 aMsg <<
"Application: " << aTitle;
161 aMsg <<
" " << wxGetCpuArchitectureName() <<
" on " << wxGetNativeCpuArchitectureName();
166 aMsg <<
"Version: " << version << eol << eol;
167 aMsg <<
"Libraries:" << eol;
169 aMsg << indent4 << wxGetLibraryVersionInfo().GetVersionString() << eol;
180 wxString osDescription;
183 osDescription = wxGetLinuxDistributionInfo().Description;
189 if( osDescription.empty() )
190 osDescription = wxGetOsDescription();
193 << osDescription <<
", "
195 << platform.GetEndiannessName() <<
", "
196 << platform.GetPortIdName();
199 if( wxTheApp && wxTheApp->IsGUI() )
203 switch( wxGetDisplayInfo().type )
205 case wxDisplayX11: aMsg <<
"X11";
break;
206 case wxDisplayWayland: aMsg <<
"Wayland";
break;
207 case wxDisplayNone: aMsg <<
"None";
break;
208 default: aMsg <<
"Unknown";
212 aMsg <<
", " << wxGetenv(
"XDG_SESSION_DESKTOP" )
213 <<
", " << wxGetenv(
"XDG_SESSION_TYPE" );
226 aMsg <<
"Build Info:" << eol;
230 aMsg << indent4 <<
"wxWidgets: " << wxVERSION_NUM_DOT_STRING <<
" (";
231 aMsg << __WX_BO_UNICODE __WX_BO_STL;
234#if wxCHECK_VERSION( 3, 3, 0 )
235 aMsg << __WX_BO_WXWIN_COMPAT_3_0
")";
237 aMsg << __WX_BO_WXWIN_COMPAT_2_8
")";
244 major = wxPlatformInfo().Get().GetToolkitMajorVersion();
245 minor = wxPlatformInfo().Get().GetToolkitMinorVersion();
246 aMsg <<
" GTK+ " << major <<
"." << minor;
251 aMsg << indent4 <<
"Boost: " << ( BOOST_VERSION / 100000 ) << wxT(
"." )
252 << ( BOOST_VERSION / 100 % 1000 ) << wxT(
"." )
253 << ( BOOST_VERSION % 100 ) << eol;
255 aMsg << indent4 <<
"OCC: " << OCC_VERSION_COMPLETE << eol;
258#if defined( NGSPICE_BUILD_VERSION )
259 aMsg << indent4 <<
"ngspice: " << NGSPICE_BUILD_VERSION << eol;
260#elif defined( NGSPICE_HAVE_CONFIG_H )
261 #undef HAVE_STRNCASECMP
262 #include <ngspice/config.h>
264#elif defined( NGSPICE_PACKAGE_VERSION )
265 aMsg << indent4 <<
"ngspice: " << NGSPICE_PACKAGE_VERSION << eol;
267 aMsg << indent4 <<
"ngspice: " <<
"unknown" << eol;
270 aMsg << indent4 <<
"Compiler: ";
271#if defined(__clang__)
272 aMsg <<
"Clang " << __clang_major__ <<
"." << __clang_minor__ <<
"." << __clang_patchlevel__;
273#elif defined(__GNUG__)
274 aMsg <<
"GCC " << __GNUC__ <<
"." << __GNUC_MINOR__ <<
"." << __GNUC_PATCHLEVEL__;
275#elif defined(_MSC_VER)
276 aMsg <<
"Visual C++ " << _MSC_VER;
277#elif defined(__INTEL_COMPILER)
278 aMsg <<
"Intel C++ " << __INTEL_COMPILER;
280 aMsg <<
"Other Compiler ";
283#if defined(__GXX_ABI_VERSION)
284 aMsg <<
" with C++ ABI " << __GXX_ABI_VERSION << eol;
286 aMsg <<
" without C++ ABI" << eol;
290#if defined( KICAD_USE_EGL ) || ! defined( NDEBUG )
292 aMsg <<
"Build settings:" << eol;
296 aMsg << indent4 <<
"KICAD_USE_EGL=" <<
ON;
300 aMsg << indent4 <<
"KICAD_IPC_API=" <<
ON;
302 aMsg << indent4 <<
"KICAD_IPC_API=" <<
OFF;
306 aMsg << indent4 <<
"KICAD_STDLIB_DEBUG=";
307#ifdef KICAD_STDLIB_DEBUG
311 aMsg << indent4 <<
"KICAD_STDLIB_LIGHT_DEBUG=";
312#ifdef KICAD_STDLIB_LIGHT_DEBUG
319 aMsg << indent4 <<
"KICAD_SANITIZE_ADDRESS=";
320#ifdef KICAD_SANITIZE_ADDRESS
326 aMsg << indent4 <<
"KICAD_SANITIZE_THREADS=";
327#ifdef KICAD_SANITIZE_THREADS
334 wxLocale* locale = wxGetLocale();
339 aMsg <<
"Locale: " << eol;
340 aMsg << indent4 <<
"Lang: " << locale->GetCanonicalName() << eol;
341 aMsg << indent4 <<
"Enc: " << locale->GetSystemEncodingName() << eol;
342 aMsg << indent4 <<
"Num: "
343 << wxString::Format(
"%d%s%.1f", 1,
344 locale->GetInfo( wxLocaleInfo::wxLOCALE_THOUSANDS_SEP ), 234.5 )
347 wxString testStr( wxS(
"кΩ丈" ) );
348 wxString expectedUtf8Hex( wxS(
"D0BACEA9E4B888" ) );
349 wxString sysHex, utf8Hex;
351 const char* asChar = testStr.c_str().AsChar();
352 size_t length = strlen( asChar );
354 for(
size_t i = 0; i < length; i++ )
355 sysHex << wxString::Format(
"%02X", (
unsigned int) (uint8_t) asChar[i] );
358 const char* asChar = testStr.utf8_str().data();
359 size_t length = strlen( asChar );
361 for(
size_t i = 0; i < length; i++ )
362 utf8Hex << wxString::Format(
"%02X", (
unsigned int) (uint8_t) asChar[i] );
365 aMsg << indent4 <<
"Encoded " << testStr <<
": " << sysHex <<
" (sys), " << utf8Hex
368 wxASSERT_MSG( utf8Hex == expectedUtf8Hex,
369 wxString::Format(
"utf8_str string %s encoding bad result: %s, expected "
370 "%s, system enc %s, lang %s",
371 testStr, utf8Hex, expectedUtf8Hex,
372 locale->GetSystemEncodingName(),
373 locale->GetCanonicalName() ) );
wxString GetBaseVersion()
Get the KiCad version string without the information added by the packagers.
wxString GetMajorMinorVersion()
Get only the major and minor version in a string major.minor.
wxString GetVersionInfoData(const wxString &aTitle, bool aHtml, bool aBrief)
Create a version info string for bug reports and the about dialog.
static wxString s_glRenderer
wxString GetCommitHash()
Get the commit hash as a string.
void SetOpenGLInfo(const char *aVendor, const char *aRenderer, const char *aVersion)
A setter for OpenGL info when it's initialized.
std::string GetCurlLibVersion()
std::string GetKicadCurlVersion()
static wxString s_glVendor
wxString GetMajorMinorPatchVersion()
Get the major, minor and patch version in a string major.minor.patch This is extracted by CMake from ...
static wxString s_glVersion
const std::tuple< int, int, int > & GetMajorMinorPatchTuple()
Get the build version numbers as a tuple.
wxString GetBuildVersion()
Get the full KiCad version string.
wxString GetSemanticVersion()
Get the semantic version string for KiCad defined inside the KiCadVersion.cmake file in the variable ...
wxString GetPlatformGetBitnessName()
bool IsNightlyVersion()
Check if the build is meant to be nightly.
wxString GetBuildDate()
Get the build date as a string.
static wxString FontConfig()
static wxString FreeType()
static wxString HarfBuzz()
< Package version metadata Package metadata