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 ) );
131 static std::tuple<int, int, int> retval = KICAD_MAJOR_MINOR_PATCH_TUPLE;
142 wxString eol = aHtml ?
"<br>" :
"\n";
145 wxString indent4 = aHtml ?
" " :
"\t";
147#define ON "ON" << eol
148#define OFF "OFF" << eol
160 wxPlatformInfo platform;
161 aMsg <<
"Application: " << aTitle;
162 aMsg <<
" " << wxGetCpuArchitectureName() <<
" on " << wxGetNativeCpuArchitectureName();
167 aMsg <<
"Version: " << version << eol << eol;
168 aMsg <<
"Libraries:" << eol;
170 aMsg << indent4 << wxGetLibraryVersionInfo().GetVersionString() << eol;
181 wxString osDescription;
184 osDescription = wxGetLinuxDistributionInfo().Description;
190 if( osDescription.empty() )
191 osDescription = wxGetOsDescription();
194 << osDescription <<
", "
196 << platform.GetEndiannessName() <<
", "
197 << platform.GetPortIdName();
200 if( wxTheApp && wxTheApp->IsGUI() )
204 switch( wxGetDisplayInfo().type )
206 case wxDisplayX11: aMsg <<
"X11";
break;
207 case wxDisplayWayland: aMsg <<
"Wayland";
break;
208 case wxDisplayNone: aMsg <<
"None";
break;
209 default: aMsg <<
"Unknown";
213 aMsg <<
", " << wxGetenv(
"XDG_SESSION_DESKTOP" )
214 <<
", " << wxGetenv(
"XDG_SESSION_TYPE" );
227 aMsg <<
"Build Info:" << eol;
231 aMsg << indent4 <<
"wxWidgets: " << wxVERSION_NUM_DOT_STRING <<
" (";
232 aMsg << __WX_BO_UNICODE __WX_BO_STL;
235#if wxCHECK_VERSION( 3, 3, 0 )
236 aMsg << __WX_BO_WXWIN_COMPAT_3_0
")";
238 aMsg << __WX_BO_WXWIN_COMPAT_2_8
")";
245 major = wxPlatformInfo().Get().GetToolkitMajorVersion();
246 minor = wxPlatformInfo().Get().GetToolkitMinorVersion();
247 aMsg <<
" GTK+ " << major <<
"." << minor;
252 aMsg << indent4 <<
"Boost: " << ( BOOST_VERSION / 100000 ) << wxT(
"." )
253 << ( BOOST_VERSION / 100 % 1000 ) << wxT(
"." )
254 << ( BOOST_VERSION % 100 ) << eol;
256 aMsg << indent4 <<
"OCC: " << OCC_VERSION_COMPLETE << eol;
259#if defined( NGSPICE_BUILD_VERSION )
260 aMsg << indent4 <<
"ngspice: " << NGSPICE_BUILD_VERSION << eol;
261#elif defined( NGSPICE_HAVE_CONFIG_H )
262 #undef HAVE_STRNCASECMP
263 #include <ngspice/config.h>
265#elif defined( NGSPICE_PACKAGE_VERSION )
266 aMsg << indent4 <<
"ngspice: " << NGSPICE_PACKAGE_VERSION << eol;
268 aMsg << indent4 <<
"ngspice: " <<
"unknown" << eol;
271 aMsg << indent4 <<
"Compiler: ";
272#if defined(__clang__)
273 aMsg <<
"Clang " << __clang_major__ <<
"." << __clang_minor__ <<
"." << __clang_patchlevel__;
274#elif defined(__GNUG__)
275 aMsg <<
"GCC " << __GNUC__ <<
"." << __GNUC_MINOR__ <<
"." << __GNUC_PATCHLEVEL__;
276#elif defined(_MSC_VER)
277 aMsg <<
"Visual C++ " << _MSC_VER;
278#elif defined(__INTEL_COMPILER)
279 aMsg <<
"Intel C++ " << __INTEL_COMPILER;
281 aMsg <<
"Other Compiler ";
284#if defined(__GXX_ABI_VERSION)
285 aMsg <<
" with C++ ABI " << __GXX_ABI_VERSION << eol;
287 aMsg <<
" without C++ ABI" << eol;
291#if defined( KICAD_USE_EGL ) || ! defined( NDEBUG )
293 aMsg <<
"Build settings:" << eol;
297 aMsg << indent4 <<
"KICAD_USE_EGL=" <<
ON;
301 aMsg << indent4 <<
"KICAD_IPC_API=" <<
ON;
303 aMsg << indent4 <<
"KICAD_IPC_API=" <<
OFF;
307 aMsg << indent4 <<
"KICAD_STDLIB_DEBUG=";
308#ifdef KICAD_STDLIB_DEBUG
312 aMsg << indent4 <<
"KICAD_STDLIB_LIGHT_DEBUG=";
313#ifdef KICAD_STDLIB_LIGHT_DEBUG
320 aMsg << indent4 <<
"KICAD_SANITIZE_ADDRESS=";
321#ifdef KICAD_SANITIZE_ADDRESS
327 aMsg << indent4 <<
"KICAD_SANITIZE_THREADS=";
328#ifdef KICAD_SANITIZE_THREADS
335 wxLocale* locale = wxGetLocale();
340 aMsg <<
"Locale: " << eol;
341 aMsg << indent4 <<
"Lang: " << locale->GetCanonicalName() << eol;
342 aMsg << indent4 <<
"Enc: " << locale->GetSystemEncodingName() << eol;
343 aMsg << indent4 <<
"Num: "
344 << wxString::Format(
"%d%s%.1f", 1,
345 locale->GetInfo( wxLocaleInfo::wxLOCALE_THOUSANDS_SEP ), 234.5 )
348 wxString testStr( wxS(
"кΩ丈" ) );
349 wxString expectedUtf8Hex( wxS(
"D0BACEA9E4B888" ) );
350 wxString sysHex, utf8Hex;
352 const char* asChar = testStr.c_str().AsChar();
353 size_t length = strlen( asChar );
355 for(
size_t i = 0; i < length; i++ )
356 sysHex << wxString::Format(
"%02X", (
unsigned int) (uint8_t) asChar[i] );
359 const char* asChar = testStr.utf8_str().data();
360 size_t length = strlen( asChar );
362 for(
size_t i = 0; i < length; i++ )
363 utf8Hex << wxString::Format(
"%02X", (
unsigned int) (uint8_t) asChar[i] );
366 aMsg << indent4 <<
"Encoded " << testStr <<
": " << sysHex <<
" (sys), " << utf8Hex
369 wxASSERT_MSG( utf8Hex == expectedUtf8Hex,
370 wxString::Format(
"utf8_str string %s encoding bad result: %s, expected "
371 "%s, system enc %s, lang %s",
372 testStr, utf8Hex, expectedUtf8Hex,
373 locale->GetSystemEncodingName(),
374 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