2014-11-21 20:56:36 +01:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// MuldeR's Utilities for Qt
|
2021-02-08 20:59:25 +01:00
|
|
|
// Copyright (C) 2004-2021 LoRd_MuldeR <MuldeR2@GMX.de>
|
2014-11-21 20:56:36 +01:00
|
|
|
//
|
|
|
|
// This library is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU Lesser General Public
|
|
|
|
// License as published by the Free Software Foundation; either
|
|
|
|
// version 2.1 of the License, or (at your option) any later version.
|
|
|
|
//
|
|
|
|
// This library 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
|
|
|
|
// Lesser General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU Lesser General Public
|
|
|
|
// License along with this library; if not, write to the Free Software
|
|
|
|
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
//
|
|
|
|
// http://www.gnu.org/licenses/lgpl-2.1.txt
|
|
|
|
//////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2014-11-24 19:35:32 +01:00
|
|
|
//MUtils
|
|
|
|
#include <MUtils/Global.h>
|
|
|
|
|
|
|
|
//Qt
|
2014-11-21 20:56:36 +01:00
|
|
|
#include <QString>
|
|
|
|
#include <QDate>
|
2014-11-24 19:35:32 +01:00
|
|
|
#include <QTime>
|
2014-11-21 20:56:36 +01:00
|
|
|
|
|
|
|
namespace MUtils
|
|
|
|
{
|
2014-11-25 02:17:11 +01:00
|
|
|
class Version
|
2014-11-21 20:56:36 +01:00
|
|
|
{
|
2014-11-24 19:35:32 +01:00
|
|
|
public:
|
2014-11-25 22:32:20 +01:00
|
|
|
//Get Library Version Numbers
|
|
|
|
MUTILS_API static const quint32 &lib_version_major(void);
|
|
|
|
MUTILS_API static const quint32 &lib_version_minor(void);
|
2014-11-21 20:56:36 +01:00
|
|
|
|
2014-11-25 22:32:20 +01:00
|
|
|
//Get Library Build Date/Time
|
|
|
|
MUTILS_API static const QDate lib_build_date(void);
|
|
|
|
MUTILS_API static const QTime lib_build_time(void);
|
|
|
|
|
|
|
|
//Get Application Build Date/Time
|
|
|
|
MUTILS_API static const QDate app_build_date(const char *const date_str = build_date_raw());
|
|
|
|
MUTILS_API static const QTime app_build_time(const char *const time_str = build_time_raw());
|
2014-11-21 20:56:36 +01:00
|
|
|
|
|
|
|
//Compiler detection
|
2014-11-25 03:16:45 +01:00
|
|
|
static const char *const compiler_version(void)
|
2014-11-24 19:35:32 +01:00
|
|
|
{
|
2017-09-15 20:37:09 +02:00
|
|
|
static const char *const COMPILER_VERS =
|
|
|
|
#if defined(__INTEL_COMPILER)
|
|
|
|
#if (__INTEL_COMPILER >= 1500)
|
|
|
|
"ICL 15." MUTILS_MAKE_STRING(__INTEL_COMPILER_BUILD_DATE);
|
|
|
|
#elif (__INTEL_COMPILER >= 1400)
|
|
|
|
"ICL 14." MUTILS_MAKE_STRING(__INTEL_COMPILER_BUILD_DATE);
|
|
|
|
#elif (__INTEL_COMPILER >= 1300)
|
|
|
|
"ICL 13." MUTILS_MAKE_STRING(__INTEL_COMPILER_BUILD_DATE);
|
|
|
|
#elif (__INTEL_COMPILER >= 1200)
|
|
|
|
"ICL 12." MUTILS_MAKE_STRING(__INTEL_COMPILER_BUILD_DATE);
|
|
|
|
#elif (__INTEL_COMPILER >= 1100)
|
|
|
|
"ICL 11.x";
|
|
|
|
#elif (__INTEL_COMPILER >= 1000)
|
|
|
|
"ICL 10.x";
|
2014-11-24 19:35:32 +01:00
|
|
|
#else
|
2017-09-15 20:37:09 +02:00
|
|
|
#error Compiler is not supported!
|
2014-11-24 19:35:32 +01:00
|
|
|
#endif
|
2017-09-15 20:37:09 +02:00
|
|
|
#elif defined(_MSC_VER)
|
2020-11-18 23:49:56 +01:00
|
|
|
#if (_MSC_VER == 1928)
|
|
|
|
"MSVC 2019.8";
|
|
|
|
#elif (_MSC_VER == 1927)
|
|
|
|
"MSVC 2019.7";
|
|
|
|
#elif (_MSC_VER == 1926)
|
2020-05-20 22:19:50 +02:00
|
|
|
"MSVC 2019.6";
|
|
|
|
#elif (_MSC_VER == 1925)
|
2020-03-29 21:38:42 +02:00
|
|
|
"MSVC 2019.5";
|
|
|
|
#elif (_MSC_VER == 1924)
|
|
|
|
"MSVC 2019.4";
|
2020-01-03 01:13:23 +01:00
|
|
|
#elif (_MSC_VER == 1923)
|
2020-03-29 21:38:42 +02:00
|
|
|
"MSVC 2019.3";
|
2019-10-05 17:56:54 +02:00
|
|
|
#elif (_MSC_VER == 1922)
|
2020-03-29 21:38:42 +02:00
|
|
|
"MSVC 2019.2";
|
2019-08-06 21:24:35 +02:00
|
|
|
#elif (_MSC_VER == 1921)
|
2020-03-29 21:38:42 +02:00
|
|
|
"MSVC 2019.1";
|
2019-06-20 18:50:23 +02:00
|
|
|
#elif (_MSC_VER == 1920)
|
2020-03-29 21:38:42 +02:00
|
|
|
"MSVC 2019.0";
|
2019-04-13 13:30:38 +02:00
|
|
|
#elif (_MSC_VER == 1916)
|
2020-03-29 21:38:42 +02:00
|
|
|
"MSVC 2017.9";
|
2018-11-26 20:51:40 +01:00
|
|
|
#elif (_MSC_VER == 1915)
|
2020-03-29 21:38:42 +02:00
|
|
|
"MSVC 2017.8";
|
2018-08-20 18:44:39 +02:00
|
|
|
#elif (_MSC_VER == 1914)
|
2020-03-29 21:38:42 +02:00
|
|
|
"MSVC 2017.7";
|
2018-05-10 18:04:02 +02:00
|
|
|
#elif (_MSC_VER == 1913)
|
2020-03-29 21:38:42 +02:00
|
|
|
"MSVC 2017.6";
|
2018-03-09 23:24:21 +01:00
|
|
|
#elif (_MSC_VER == 1912)
|
2020-03-29 21:38:42 +02:00
|
|
|
"MSVC 2017.5";
|
2017-12-06 01:04:04 +01:00
|
|
|
#elif (_MSC_VER == 1911)
|
2020-03-29 21:38:42 +02:00
|
|
|
"MSVC 2017.4";
|
2017-09-15 20:37:09 +02:00
|
|
|
#elif (_MSC_VER == 1910)
|
2020-03-29 21:38:42 +02:00
|
|
|
"MSVC 2017.2";
|
2017-09-15 20:37:09 +02:00
|
|
|
#elif (_MSC_VER == 1900)
|
|
|
|
#if (_MSC_FULL_VER == 190023026)
|
|
|
|
"MSVC 2015";
|
|
|
|
#elif (_MSC_FULL_VER == 190023506)
|
|
|
|
"MSVC 2015.1";
|
|
|
|
#elif (_MSC_FULL_VER == 190023918)
|
|
|
|
"MSVC 2015.2";
|
|
|
|
#elif (_MSC_FULL_VER == 190024210) || (_MSC_FULL_VER == 190024215)
|
|
|
|
"MSVC 2015.3";
|
|
|
|
#else
|
|
|
|
#error Compiler version is not supported yet!
|
|
|
|
#endif
|
|
|
|
#elif (_MSC_VER == 1800)
|
|
|
|
#if (_MSC_FULL_VER == 180021005)
|
|
|
|
"MSVC 2013";
|
|
|
|
#elif (_MSC_FULL_VER == 180030501)
|
|
|
|
"MSVC 2013.2";
|
|
|
|
#elif (_MSC_FULL_VER == 180030723)
|
|
|
|
"MSVC 2013.3";
|
|
|
|
#elif (_MSC_FULL_VER == 180031101)
|
|
|
|
"MSVC 2013.4";
|
|
|
|
#elif (_MSC_FULL_VER == 180040629)
|
|
|
|
"MSVC 2013.5";
|
|
|
|
#else
|
|
|
|
#error Compiler version is not supported yet!
|
|
|
|
#endif
|
|
|
|
#elif (_MSC_VER == 1700)
|
|
|
|
#if (_MSC_FULL_VER == 170050727)
|
|
|
|
"MSVC 2012";
|
|
|
|
#elif (_MSC_FULL_VER == 170051106)
|
|
|
|
"MSVC 2012.1";
|
|
|
|
#elif (_MSC_FULL_VER == 170060315)
|
|
|
|
"MSVC 2012.2";
|
|
|
|
#elif (_MSC_FULL_VER == 170060610)
|
|
|
|
"MSVC 2012.3";
|
|
|
|
#elif (_MSC_FULL_VER == 170061030)
|
|
|
|
"MSVC 2012.4";
|
|
|
|
#else
|
|
|
|
#error Compiler version is not supported yet!
|
|
|
|
#endif
|
|
|
|
#elif (_MSC_VER == 1600)
|
|
|
|
#if (_MSC_FULL_VER >= 160040219)
|
|
|
|
"MSVC 2010-SP1";
|
|
|
|
#else
|
|
|
|
"MSVC 2010";
|
|
|
|
#endif
|
2014-11-24 19:35:32 +01:00
|
|
|
#else
|
2017-09-15 20:37:09 +02:00
|
|
|
#error Compiler is not supported!
|
2014-11-24 19:35:32 +01:00
|
|
|
#endif
|
2014-11-21 20:56:36 +01:00
|
|
|
#else
|
2014-11-24 19:35:32 +01:00
|
|
|
#error Compiler is not supported!
|
2014-11-21 20:56:36 +01:00
|
|
|
#endif
|
2014-11-24 19:35:32 +01:00
|
|
|
return COMPILER_VERS;
|
|
|
|
}
|
2014-11-21 20:56:36 +01:00
|
|
|
|
|
|
|
//Architecture detection
|
2014-11-25 03:16:45 +01:00
|
|
|
static const char *const compiler_arch(void)
|
2014-11-24 19:35:32 +01:00
|
|
|
{
|
2017-09-15 20:37:09 +02:00
|
|
|
static const char *const COMPILER_ARCH =
|
|
|
|
#if defined(_M_X64)
|
|
|
|
"x64";
|
|
|
|
#elif defined(_M_IX86)
|
|
|
|
"x86";
|
|
|
|
#else
|
|
|
|
#error Architecture is not supported!
|
|
|
|
#endif
|
2014-11-24 19:35:32 +01:00
|
|
|
return COMPILER_ARCH;
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
//Raw Build date
|
|
|
|
static const char *const build_date_raw(void)
|
|
|
|
{
|
|
|
|
static const char *const RAW_BUILD_DATE = __DATE__;
|
|
|
|
return RAW_BUILD_DATE;
|
|
|
|
}
|
|
|
|
|
2014-11-25 02:17:11 +01:00
|
|
|
//Raw Build time
|
2014-11-24 19:35:32 +01:00
|
|
|
static const char *const build_time_raw(void)
|
|
|
|
{
|
|
|
|
static const char *const RAW_BUILD_TIME = __TIME__;
|
|
|
|
return RAW_BUILD_TIME;
|
|
|
|
}
|
|
|
|
|
|
|
|
//Disable construction
|
|
|
|
Version(void) { throw 666; }
|
|
|
|
Version(const Version&) { throw 666; }
|
|
|
|
};
|
2014-11-21 20:56:36 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|