diff options
Diffstat (limited to 'src/corelib/global/qlibraryinfo.cpp')
-rw-r--r-- | src/corelib/global/qlibraryinfo.cpp | 65 |
1 files changed, 47 insertions, 18 deletions
diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp index 174c1d0d8d..f2ebeb6a03 100644 --- a/src/corelib/global/qlibraryinfo.cpp +++ b/src/corelib/global/qlibraryinfo.cpp @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Copyright (C) 2014 Intel Corporation ** Contact: http://www.qt-project.org/legal ** ** This file is part of the QtCore module of the Qt Toolkit. @@ -67,6 +68,7 @@ QString qt_libraryInfoFile() #endif #include "qconfig.cpp" +#include "archdetect.cpp" QT_BEGIN_NAMESPACE @@ -255,7 +257,37 @@ QLibraryInfo::buildDate() } #endif //QT_NO_DATESTRING -#if defined(Q_CC_CLANG) // must be before GNU, because clang claims to be GNU too +#if defined(Q_CC_INTEL) // must be before GNU, Clang and MSVC because ICC/ICL claim to be them +# ifdef __INTEL_CLANG_COMPILER +# define ICC_COMPAT "Clang" +# elif defined(__INTEL_MS_COMPAT_LEVEL) +# define ICC_COMPAT "Microsoft" +# elif defined(__GNUC__) +# define ICC_COMPAT "GCC" +# else +# define ICC_COMPAT "no" +# endif +# if __INTEL_COMPILER == 1300 +# define ICC_VERSION "13.0" +# elif __INTEL_COMPILER == 1310 +# define ICC_VERSION "13.1" +# elif __INTEL_COMPILER == 1400 +# define ICC_VERSION "14.0" +# elif __INTEL_COMPILER == 1500 +# define ICC_VERSION "15.0" +# else +# define ICC_VERSION QT_STRINGIFY(__INTEL_COMPILER) +# endif +# ifdef __INTEL_COMPILER_UPDATE +# define COMPILER_STRING "Intel(R) C++ " ICC_VERSION "." QT_STRINGIFY(__INTEL_COMPILER_UPDATE) \ + " build " QT_STRINGIFY(__INTEL_COMPILER_BUILD_DATE) " [" \ + ICC_COMPAT " compatibility]" +# else +# define COMPILER_STRING "Intel(R) C++ " ICC_VERSION \ + " build " QT_STRINGIFY(__INTEL_COMPILER_BUILD_DATE) " [" \ + ICC_COMPAT " compatibility]" +# endif +#elif defined(Q_CC_CLANG) // must be before GNU, because clang claims to be GNU too # ifdef __apple_build_version__ // Apple clang has other version numbers # define COMPILER_STRING "Clang " __clang_version__ " (Apple)" # else @@ -273,11 +305,22 @@ QLibraryInfo::buildDate() # elif _MSC_VER < 1900 # define COMPILER_STRING "MSVC 2013" # else -# define COMPILER_STRING "MSVC <unknown version>" +# define COMPILER_STRING "MSVC _MSC_VER " QT_STRINGIFY(_MSC_VER) # endif #else # define COMPILER_STRING "<unknown compiler>" #endif +#ifdef QT_NO_DEBUG +# define DEBUG_STRING " release" +#else +# define DEBUG_STRING " debug" +#endif +#ifdef QT_SHARED +# define SHARED_STRING " shared (dynamic)" +#else +# define SHARED_STRING " static" +#endif +#define QT_BUILD_STR "Qt " QT_VERSION_STR " (" ARCH_FULL SHARED_STRING DEBUG_STRING " build; by " COMPILER_STRING ")" /*! Returns a string describing how this version of Qt was built. @@ -289,21 +332,7 @@ QLibraryInfo::buildDate() const char *QLibraryInfo::build() Q_DECL_NOTHROW { - static const char data[] = "Qt " QT_VERSION_STR " (" __DATE__ ", " - COMPILER_STRING ", " -#if QT_POINTER_SIZE == 4 - "32" -#else - "64" -#endif - " bit, " -#ifdef QT_NO_DEBUG - "release" -#else - "debug" -#endif - " build)"; - return data; + return QT_BUILD_STR; } /*! @@ -590,7 +619,7 @@ extern const char qt_core_interpreter[] __attribute__((section(".interp"))) extern "C" void qt_core_boilerplate(); void qt_core_boilerplate() { - printf("This is the QtCore library version " QT_VERSION_STR "\n" + printf("This is the QtCore library version " QT_BUILD_STR "\n" "Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n" "Contact: http://www.qt-project.org/legal\n" "\n" |