2014-10-19 20:20:16 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
2015-01-16 08:10:23 +00:00
|
|
|
* Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
2020-03-07 18:43:24 +00:00
|
|
|
* Copyright (C) 2015-2020 KiCad Developers, see AUTHORS.txt for contributors.
|
2014-10-19 20:20:16 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, you may find one here:
|
|
|
|
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
|
|
|
* or you may search the http://www.gnu.org website for the version 2 license,
|
|
|
|
* or you may write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
2015-11-24 10:05:34 +00:00
|
|
|
// Date for KiCad build version
|
2020-10-02 16:31:19 +00:00
|
|
|
#include <wx/wx.h>
|
|
|
|
#include <config.h>
|
2020-05-25 00:39:15 +00:00
|
|
|
#include <boost/version.hpp>
|
2021-06-09 01:02:10 +00:00
|
|
|
#include <kiplatform/app.h>
|
2020-05-25 00:39:15 +00:00
|
|
|
|
|
|
|
// kicad_curl.h must be included before wx headers, to avoid
|
|
|
|
// conflicts for some defines, at least on Windows
|
|
|
|
// kicad_curl.h can create conflicts for some defines, at least on Windows
|
|
|
|
// so we are using here 2 proxy functions to know Curl version to avoid
|
|
|
|
// including kicad_curl.h to know Curl version
|
|
|
|
extern std::string GetKicadCurlVersion();
|
|
|
|
extern std::string GetCurlLibVersion();
|
|
|
|
|
2021-12-01 15:53:00 +00:00
|
|
|
#if defined( KICAD_USE_OCC )
|
2020-05-25 00:39:15 +00:00
|
|
|
#include <Standard_Version.hxx>
|
|
|
|
#endif
|
2010-01-05 17:47:49 +00:00
|
|
|
|
2021-08-09 21:19:31 +00:00
|
|
|
#if defined( KICAD_SPICE )
|
|
|
|
#include <ngspice/sharedspice.h>
|
|
|
|
#endif
|
|
|
|
|
2015-07-05 19:24:34 +00:00
|
|
|
// The include file version.h is always created even if the repo version cannot be
|
2019-11-11 17:57:33 +00:00
|
|
|
// determined. In this case KICAD_VERSION_FULL will default to the KICAD_VERSION
|
|
|
|
// that is set in KiCadVersion.cmake.
|
2015-11-24 10:05:34 +00:00
|
|
|
#include <kicad_build_version.h>
|
2010-01-05 17:47:49 +00:00
|
|
|
|
|
|
|
|
2021-11-13 08:52:08 +00:00
|
|
|
wxString GetPlatformGetBitnessName()
|
|
|
|
{
|
|
|
|
wxPlatformInfo platform;
|
|
|
|
// TODO (ISM): Read conditional once our wx fork and flatpaks are running released 3.1.5
|
|
|
|
#if 0 && wxCHECK_VERSION( 3, 1, 5 )
|
|
|
|
return platform.GetBitnessName();
|
|
|
|
#else
|
|
|
|
return platform.GetArchName();
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-01-05 17:47:49 +00:00
|
|
|
wxString GetBuildVersion()
|
|
|
|
{
|
2019-11-11 17:57:33 +00:00
|
|
|
wxString msg = wxString::Format( wxT( "%s" ), wxT( KICAD_VERSION_FULL ) );
|
|
|
|
return msg;
|
|
|
|
}
|
2013-08-05 15:38:50 +00:00
|
|
|
|
2019-11-11 17:57:33 +00:00
|
|
|
|
|
|
|
wxString GetBuildDate()
|
|
|
|
{
|
|
|
|
wxString msg = wxString::Format( wxT( "%s %s" ), wxT( __DATE__ ), wxT( __TIME__ ) );
|
2010-01-05 17:47:49 +00:00
|
|
|
return msg;
|
|
|
|
}
|
2020-03-07 18:43:24 +00:00
|
|
|
|
|
|
|
|
|
|
|
wxString GetSemanticVersion()
|
|
|
|
{
|
|
|
|
wxString msg = wxString::Format( wxT( "%s" ), wxT( KICAD_SEMANTIC_VERSION ) );
|
|
|
|
return msg;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
wxString GetMajorMinorVersion()
|
|
|
|
{
|
|
|
|
wxString msg = wxString::Format( wxT( "%s" ), wxT( KICAD_MAJOR_MINOR_VERSION ) );
|
|
|
|
return msg;
|
|
|
|
}
|
2020-05-25 00:39:15 +00:00
|
|
|
|
|
|
|
|
|
|
|
wxString GetVersionInfoData( const wxString& aTitle, bool aHtml, bool aBrief )
|
|
|
|
{
|
|
|
|
wxString aMsg;
|
|
|
|
// DO NOT translate information in the msg_version string
|
|
|
|
|
2022-02-05 00:24:26 +00:00
|
|
|
wxString eol = aHtml ? wxT( "<br>" ) : wxT( "\n" );
|
2020-05-25 00:39:15 +00:00
|
|
|
|
|
|
|
// Tabs instead of spaces for the plaintext version for shorter string length
|
2022-02-05 00:24:26 +00:00
|
|
|
wxString indent4 = aHtml ? wxT( " " ) : wxT( "\t" );
|
2020-05-25 00:39:15 +00:00
|
|
|
|
2022-02-05 00:24:26 +00:00
|
|
|
#define ON wxT( "ON" ) << eol
|
|
|
|
#define OFF wxT( "OFF" ) << eol
|
2020-05-25 00:39:15 +00:00
|
|
|
|
|
|
|
wxString version;
|
2022-02-05 00:24:26 +00:00
|
|
|
version << ( KIPLATFORM::APP::IsOperatingSystemUnsupported() ? wxT( "(UNSUPPORTED)" )
|
2021-06-09 01:02:10 +00:00
|
|
|
: GetBuildVersion() )
|
2020-05-25 00:39:15 +00:00
|
|
|
#ifdef DEBUG
|
2022-02-05 00:24:26 +00:00
|
|
|
<< wxT( ", debug" )
|
2020-05-25 00:39:15 +00:00
|
|
|
#else
|
2022-02-05 00:24:26 +00:00
|
|
|
<< wxT( ", release" )
|
2020-05-25 00:39:15 +00:00
|
|
|
#endif
|
2022-02-05 00:24:26 +00:00
|
|
|
<< wxT( " build" );
|
2020-05-25 00:39:15 +00:00
|
|
|
|
|
|
|
wxPlatformInfo platform;
|
2022-02-05 00:24:26 +00:00
|
|
|
aMsg << wxT( "Application: " ) << aTitle;
|
2021-04-30 23:16:47 +00:00
|
|
|
|
|
|
|
#if defined( KICAD_BUILD_ARCH_X64 )
|
2022-02-05 00:24:26 +00:00
|
|
|
aMsg << wxT( " (64-bit)" );
|
2021-04-30 23:25:57 +00:00
|
|
|
#elif defined( KICAD_BUILD_ARCH_X86 )
|
2022-02-05 00:24:26 +00:00
|
|
|
aMsg << wxT( " (32-bit)" );
|
2021-04-30 23:25:57 +00:00
|
|
|
#elif defined( KICAD_BUILD_ARCH_ARM )
|
2022-02-05 00:24:26 +00:00
|
|
|
aMsg << wxT( " (ARM 32-bit)" );
|
2021-04-30 23:25:57 +00:00
|
|
|
#elif defined( KICAD_BUILD_ARCH_ARM64 )
|
2022-02-05 00:24:26 +00:00
|
|
|
aMsg << wxT( " (ARM 64-bit)" );
|
2021-04-30 23:16:47 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
aMsg << eol << eol;
|
|
|
|
|
|
|
|
|
2022-02-05 00:24:26 +00:00
|
|
|
aMsg << wxT( "Version: " ) << version << eol << eol;
|
|
|
|
aMsg << wxT( "Libraries:" ) << eol;
|
2020-05-25 00:39:15 +00:00
|
|
|
|
|
|
|
aMsg << indent4 << wxGetLibraryVersionInfo().GetVersionString() << eol;
|
|
|
|
|
|
|
|
if( !aBrief )
|
|
|
|
aMsg << indent4 << GetKicadCurlVersion() << eol;
|
|
|
|
|
2020-07-08 17:28:26 +00:00
|
|
|
aMsg << eol;
|
|
|
|
|
2022-02-05 00:24:26 +00:00
|
|
|
aMsg << wxT( "Platform: " ) << wxGetOsDescription() << wxT( ", " )
|
|
|
|
<< GetPlatformGetBitnessName() << wxT( ", " )
|
|
|
|
<< platform.GetEndiannessName() << wxT( ", " )
|
2020-09-28 16:41:28 +00:00
|
|
|
<< platform.GetPortIdName();
|
2020-05-25 00:39:15 +00:00
|
|
|
|
2020-09-28 16:41:28 +00:00
|
|
|
#ifdef __WXGTK__
|
2022-02-05 00:24:26 +00:00
|
|
|
aMsg << wxT( ", " ) << wxGetenv( wxT( "XDG_SESSION_DESKTOP" ) )
|
|
|
|
<< wxT( ", " ) << wxGetenv( wxT( "XDG_SESSION_TYPE" ) );
|
2020-09-28 16:41:28 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
aMsg << eol << eol;
|
2020-07-08 17:28:26 +00:00
|
|
|
|
2020-05-25 00:39:15 +00:00
|
|
|
if( !aBrief )
|
2020-10-30 19:31:23 +00:00
|
|
|
{
|
2022-02-05 00:24:26 +00:00
|
|
|
aMsg << wxT( "Build Info:" ) << eol;
|
|
|
|
aMsg << indent4 << wxT( "Date: " ) << GetBuildDate() << eol;
|
2020-10-30 19:31:23 +00:00
|
|
|
}
|
2020-05-25 00:39:15 +00:00
|
|
|
|
2022-02-05 00:24:26 +00:00
|
|
|
aMsg << indent4 << wxT( "wxWidgets: " ) << wxVERSION_NUM_DOT_STRING << wxT( " (" );
|
|
|
|
aMsg << __WX_BO_UNICODE __WX_BO_STL __WX_BO_WXWIN_COMPAT_2_8 wxT( ")" );
|
2020-05-25 00:39:15 +00:00
|
|
|
|
|
|
|
// Get the GTK+ version where possible.
|
|
|
|
#ifdef __WXGTK__
|
|
|
|
int major, minor;
|
|
|
|
|
|
|
|
major = wxPlatformInfo().Get().GetToolkitMajorVersion();
|
|
|
|
minor = wxPlatformInfo().Get().GetToolkitMinorVersion();
|
2022-02-05 00:24:26 +00:00
|
|
|
aMsg << wxT( " GTK+ " ) << major << wxT( "." ) << minor;
|
2020-05-25 00:39:15 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
aMsg << eol;
|
|
|
|
|
2022-02-05 00:24:26 +00:00
|
|
|
aMsg << indent4 << wxT( "Boost: " ) << ( BOOST_VERSION / 100000 ) << wxT( "." )
|
2020-05-25 00:39:15 +00:00
|
|
|
<< ( BOOST_VERSION / 100 % 1000 ) << wxT( "." )
|
|
|
|
<< ( BOOST_VERSION % 100 ) << eol;
|
|
|
|
|
|
|
|
#ifdef KICAD_USE_OCC
|
2022-02-05 00:24:26 +00:00
|
|
|
aMsg << indent4 << wxT( "OCC: " ) << OCC_VERSION_COMPLETE << eol;
|
2020-05-25 00:39:15 +00:00
|
|
|
#endif
|
|
|
|
|
2022-02-05 00:24:26 +00:00
|
|
|
aMsg << indent4 << wxT( "Curl: " ) << GetCurlLibVersion() << eol;
|
2020-05-25 00:39:15 +00:00
|
|
|
|
2020-07-11 20:33:41 +00:00
|
|
|
#if defined( KICAD_SPICE )
|
|
|
|
#if defined( NGSPICE_BUILD_VERSION )
|
2022-02-05 00:24:26 +00:00
|
|
|
aMsg << indent4 << wxT( "ngspice: " ) << NGSPICE_BUILD_VERSION << eol;
|
2020-07-11 20:33:41 +00:00
|
|
|
#elif defined( NGSPICE_HAVE_CONFIG_H )
|
2020-08-07 11:13:25 +00:00
|
|
|
#undef HAVE_STRNCASECMP /* is redefined in ngspice/config.h */
|
2020-07-11 20:33:41 +00:00
|
|
|
#include <ngspice/config.h>
|
2022-02-05 00:24:26 +00:00
|
|
|
aMsg << indent4 << wxT( "ngspice: " ) << PACKAGE_VERSION << eol;
|
2021-08-09 21:19:31 +00:00
|
|
|
#elif defined( NGSPICE_PACKAGE_VERSION )
|
2022-02-05 00:24:26 +00:00
|
|
|
aMsg << indent4 << wxT( "ngspice: " ) << NGSPICE_PACKAGE_VERSION << eol;
|
2020-07-11 20:33:41 +00:00
|
|
|
#else
|
2022-02-05 00:24:26 +00:00
|
|
|
aMsg << indent4 << wxT( "ngspice: " ) << wxT( "unknown" ) << eol;
|
2020-07-11 20:33:41 +00:00
|
|
|
#endif
|
2020-07-08 17:28:26 +00:00
|
|
|
#endif
|
|
|
|
|
2022-02-05 00:24:26 +00:00
|
|
|
aMsg << indent4 << wxT( "Compiler: " );
|
2020-05-25 00:39:15 +00:00
|
|
|
#if defined(__clang__)
|
2022-02-05 00:24:26 +00:00
|
|
|
aMsg << wxT( "Clang " ) << __clang_major__ << wxT( "." ) << __clang_minor__ << wxT( "." ) << __clang_patchlevel__;
|
2020-05-25 00:39:15 +00:00
|
|
|
#elif defined(__GNUG__)
|
2022-02-05 00:24:26 +00:00
|
|
|
aMsg << wxT( "GCC " ) << __GNUC__ << wxT( "." ) << __GNUC_MINOR__ << wxT( "." ) << __GNUC_PATCHLEVEL__;
|
2020-05-25 00:39:15 +00:00
|
|
|
#elif defined(_MSC_VER)
|
2022-02-05 00:24:26 +00:00
|
|
|
aMsg << wxT( "Visual C++ " ) << _MSC_VER;
|
2020-05-25 00:39:15 +00:00
|
|
|
#elif defined(__INTEL_COMPILER)
|
2022-02-05 00:24:26 +00:00
|
|
|
aMsg << wxT( "Intel C++ " ) << __INTEL_COMPILER;
|
2020-05-25 00:39:15 +00:00
|
|
|
#else
|
2022-02-05 00:24:26 +00:00
|
|
|
aMsg << wxT( "Other Compiler " );
|
2020-05-25 00:39:15 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(__GXX_ABI_VERSION)
|
2022-02-05 00:24:26 +00:00
|
|
|
aMsg << wxT( " with C++ ABI " ) << __GXX_ABI_VERSION << eol;
|
2020-05-25 00:39:15 +00:00
|
|
|
#else
|
2022-02-05 00:24:26 +00:00
|
|
|
aMsg << wxT( " without C++ ABI" ) << eol;
|
2020-05-25 00:39:15 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
aMsg << eol;
|
|
|
|
|
|
|
|
// Add build settings config (build options):
|
2022-02-05 00:24:26 +00:00
|
|
|
aMsg << wxT( "Build settings:" ) << eol;
|
2020-05-25 00:39:15 +00:00
|
|
|
|
|
|
|
#ifdef KICAD_USE_OCC
|
2022-02-05 00:24:26 +00:00
|
|
|
aMsg << indent4 << wxT( "KICAD_USE_OCC=" ) << ON;
|
2020-05-25 00:39:15 +00:00
|
|
|
#endif
|
|
|
|
|
2020-11-10 23:24:01 +00:00
|
|
|
#ifdef KICAD_USE_EGL
|
2022-02-05 00:24:26 +00:00
|
|
|
aMsg << indent4 << wxT( "KICAD_USE_EGL=" ) << ON;
|
2020-11-10 23:24:01 +00:00
|
|
|
#endif
|
|
|
|
|
2022-02-05 00:24:26 +00:00
|
|
|
aMsg << indent4 << wxT( "KICAD_SPICE=" );
|
2020-05-25 00:39:15 +00:00
|
|
|
#ifdef KICAD_SPICE
|
|
|
|
aMsg << ON;
|
|
|
|
#else
|
|
|
|
aMsg << OFF;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef NDEBUG
|
2022-02-05 00:24:26 +00:00
|
|
|
aMsg << indent4 << wxT( "KICAD_STDLIB_DEBUG=" );
|
2020-05-25 00:39:15 +00:00
|
|
|
#ifdef KICAD_STDLIB_DEBUG
|
|
|
|
aMsg << ON;
|
|
|
|
#else
|
|
|
|
aMsg << OFF;
|
2022-02-05 00:24:26 +00:00
|
|
|
aMsg << indent4 << wxT( "KICAD_STDLIB_LIGHT_DEBUG=" );
|
2020-05-25 00:39:15 +00:00
|
|
|
#ifdef KICAD_STDLIB_LIGHT_DEBUG
|
|
|
|
aMsg << ON;
|
|
|
|
#else
|
|
|
|
aMsg << OFF;
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
2022-02-05 00:24:26 +00:00
|
|
|
aMsg << indent4 << wxT( "KICAD_SANITIZE_ADDRESS=" );
|
2021-04-16 14:53:13 +00:00
|
|
|
#ifdef KICAD_SANITIZE_ADDRESS
|
|
|
|
aMsg << ON;
|
|
|
|
#else
|
|
|
|
aMsg << OFF;
|
|
|
|
#endif
|
|
|
|
|
2022-02-05 00:24:26 +00:00
|
|
|
aMsg << indent4 << wxT( "KICAD_SANITIZE_THREADS=" );
|
2021-04-16 14:53:13 +00:00
|
|
|
#ifdef KICAD_SANITIZE_THREADS
|
2020-05-25 00:39:15 +00:00
|
|
|
aMsg << ON;
|
|
|
|
#else
|
|
|
|
aMsg << OFF;
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
return aMsg;
|
2020-07-08 17:28:26 +00:00
|
|
|
}
|