From d7515fbae4f305c352014a3cd008cc1f60f9d45a Mon Sep 17 00:00:00 2001 From: "Alexander V. Wolf" Date: Tue, 30 Jan 2024 15:07:09 +0700 Subject: [PATCH] compiler: updated the compiler version info --- CMakeLists.txt | 4 +++ src/StelLogger.cpp | 3 +- src/core/StelUtils.cpp | 65 ------------------------------------------ src/core/StelUtils.hpp | 3 -- 4 files changed, 5 insertions(+), 70 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2e18dd648b044..15720607a19f5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -72,6 +72,10 @@ SET(COPYRIGHT_YEARS "2000-${CURRENTYEAR}") SET(STELLARIUM_URL "https://stellarium.org/") ADD_DEFINITIONS(-DSTELLARIUM_URL="${STELLARIUM_URL}") +# remembering the name and the version of compiler for StelLogger +SET(STELLARIUM_COMPILER "${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}") +ADD_DEFINITIONS(-DSTELLARIUM_COMPILER="${STELLARIUM_COMPILER}") + # The line below is copied from src/gui/HelpDialog.cpp file SET(STELLARIUM_COPYRIGHT "Copyright (C) ${COPYRIGHT_YEARS} ${PROJECT_NAME} Developers") # The line below is copied from src/main.cpp file diff --git a/src/StelLogger.cpp b/src/StelLogger.cpp index 1dd0663c0efce..05a432ef70aef 100644 --- a/src/StelLogger.cpp +++ b/src/StelLogger.cpp @@ -78,8 +78,7 @@ void StelLogger::init(const QString& logFilePath) writeLog(QString("Operating System: %1").arg(StelUtils::getOperatingSystemInfo())); // write compiler version - QString compiler = StelUtils::getCompilerInfo(); - writeLog(compiler.isEmpty() ? "Unknown compiler" : QString("Compiled using %1").arg(compiler)); + writeLog(QString("Compiled using %1").arg(STELLARIUM_COMPILER)); // write Qt version writeLog(QString("Qt runtime version: %1").arg(qVersion())); diff --git a/src/core/StelUtils.cpp b/src/core/StelUtils.cpp index 0fcf6f80bc8b8..9524922e7dfe9 100644 --- a/src/core/StelUtils.cpp +++ b/src/core/StelUtils.cpp @@ -93,71 +93,6 @@ QString getOperatingSystemInfo() return OS; } -QString getCompilerInfo() -{ - QString compilerInfo = ""; - - #if defined __GNUC__ && !defined __clang__ && !defined __INTEL_COMPILER - #ifdef __MINGW32__ - #define COMPILER "MinGW GCC" - #else - #define COMPILER "GCC" - #endif - compilerInfo = QString("%1 %2.%3.%4").arg(COMPILER).arg(__GNUC__).arg(__GNUC_MINOR__).arg(__GNUC_PATCHLEVEL__); - #elif defined __clang__ - #ifdef Q_OS_MACOS - #define COMPILER "Clang (Apple)" - #else - #define COMPILER "Clang" - #endif - compilerInfo = QString("%1 %2.%3.%4").arg(COMPILER).arg(__clang_major__).arg(__clang_minor__).arg(__clang_patchlevel__); - #elif defined __INTEL_COMPILER - QString iccVer = QString::number(__INTEL_COMPILER); - int iccVL = iccVer.length(); - compilerInfo = QString("%1 %2.%3.%4.%5").arg("Intel C/C++").arg(iccVer.mid(0, iccVL-2)).arg(iccVer.mid(iccVL-2,1)).arg(iccVer.mid(iccVL-1,1)).arg(__INTEL_COMPILER_BUILD_DATE); - #elif defined _MSC_VER - // Defines for _MSC_VER macro: https://docs.microsoft.com/ru-ru/cpp/preprocessor/predefined-macros?view=msvc-160 - const QMap map = { - {1310, "MSVC++ 7.1 (Visual Studio 2003)" }, - {1400, "MSVC++ 8.0 (Visual Studio 2005)" }, - {1500, "MSVC++ 9.0 (Visual Studio 2008)" }, - {1600, "MSVC++ 10.0 (Visual Studio 2010)" }, - {1700, "MSVC++ 11.0 (Visual Studio 2012)" }, - {1800, "MSVC++ 12.0 (Visual Studio 2013)" }, - {1900, "MSVC++ 14.0 (Visual Studio 2015)" }, - {1910, "MSVC++ 15.0 (Visual Studio 2017 RTW)" }, - {1911, "MSVC++ 15.3 (Visual Studio 2017)" }, - {1912, "MSVC++ 15.5 (Visual Studio 2017)" }, - {1913, "MSVC++ 15.6 (Visual Studio 2017)" }, - {1914, "MSVC++ 15.7 (Visual Studio 2017)" }, - {1915, "MSVC++ 15.8 (Visual Studio 2017)" }, - {1916, "MSVC++ 15.9 (Visual Studio 2017)" }, - {1920, "MSVC++ 16.0 (Visual Studio 2019 RTW)" }, - {1921, "MSVC++ 16.1 (Visual Studio 2019)" }, - {1922, "MSVC++ 16.2 (Visual Studio 2019)" }, - {1923, "MSVC++ 16.3 (Visual Studio 2019)" }, - {1924, "MSVC++ 16.4 (Visual Studio 2019)" }, - {1925, "MSVC++ 16.5 (Visual Studio 2019)" }, - {1926, "MSVC++ 16.6 (Visual Studio 2019)" }, - {1927, "MSVC++ 16.7 (Visual Studio 2019)" }, - {1928, "MSVC++ 16.8, 16.9 (Visual Studio 2019)" }, - {1929, "MSVC++ 16.10, 16.11 (Visual Studio 2019)" }, - {1930, "MSVC++ 17.0 (Visual Studio 2022 RTW)" }, - {1931, "MSVC++ 17.1 (Visual Studio 2022)" }, - {1932, "MSVC++ 17.2 (Visual Studio 2022)" }, - {1933, "MSVC++ 17.3 (Visual Studio 2022)" }, - {1934, "MSVC++ 17.4 (Visual Studio 2022)" }, - {1935, "MSVC++ 17.5 (Visual Studio 2022)" }, - {1936, "MSVC++ 17.6 (Visual Studio 2022)" }, - {1937, "MSVC++ 17.7 (Visual Studio 2022)" }, - {1938, "MSVC++ 17.8 (Visual Studio 2022)" } - }; - compilerInfo = map.value(_MSC_VER, "unknown MSVC++ version"); - #endif - - return compilerInfo; -} - double hmsStrToHours(const QString& s) { static const QRegularExpression reg("(\\d+)h(\\d+)m(\\d+)s"); diff --git a/src/core/StelUtils.hpp b/src/core/StelUtils.hpp index 23340529850ed..2cee3a96b4900 100644 --- a/src/core/StelUtils.hpp +++ b/src/core/StelUtils.hpp @@ -97,9 +97,6 @@ namespace StelUtils //! Return the name and the version of operating system, i.e. "macOS 12.5" QString getOperatingSystemInfo(); - //! Return the name and the version of compiler, which was used for building the planetarium, i.e. "GCC 9.3.0" - QString getCompilerInfo(); - //! Return the user agent name, i.e. "Stellarium/0.15.0 (Linux)" QString getUserAgentString();